|
| 1 | +name: Build |
| 2 | +on: [push, pull_request, workflow_dispatch] |
| 3 | +env: |
| 4 | + VERSION: "1.0.0" |
| 5 | +jobs: |
| 6 | + java_8: |
| 7 | + name: 🔥 Build [Java 8] |
| 8 | + runs-on: ubuntu-latest |
| 9 | + env: |
| 10 | + JAVA_VERSION: 8 |
| 11 | + steps: |
| 12 | + |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + |
| 15 | + - name: ❤️ Set up Java ${{ env.JAVA_VERSION }} |
| 16 | + uses: actions/setup-java@v2 |
| 17 | + with: |
| 18 | + java-version: ${{ env.JAVA_VERSION }} |
| 19 | + distribution: 'adopt' |
| 20 | + architecture: x64 |
| 21 | + |
| 22 | + - name: 🍎 Cache the Maven packages to speed up build |
| 23 | + uses: actions/cache@v1 |
| 24 | + with: |
| 25 | + path: ~/.m2 |
| 26 | + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| 27 | + restore-keys: ${{ runner.os }}-m2 |
| 28 | + |
| 29 | + - name: 😎 Create artifact directory |
| 30 | + run: mkdir ${{ GITHUB.WORKSPACE }}/DownloadArtifact |
| 31 | + |
| 32 | + - name: 💻 Build Protocol |
| 33 | + run: | |
| 34 | + cd Protocol |
| 35 | + mvn clean install -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e |
| 36 | + mvn -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e package --file pom.xml |
| 37 | + |
| 38 | + - name: 💻 Build BungeeCord |
| 39 | + run: | |
| 40 | + cd BungeeCord |
| 41 | + mvn clean install -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e |
| 42 | + mvn -Dcompile.output=${{ GITHUB.WORKSPACE }}/DownloadArtifact -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e package --file pom.xml |
| 43 | + |
| 44 | + - name: 💻 Build Spigot |
| 45 | + run: | |
| 46 | + cd Spigot |
| 47 | + mvn clean install -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e |
| 48 | + mvn -Dcompile.output=${{ GITHUB.WORKSPACE }}/DownloadArtifact -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e package --file pom.xml |
| 49 | + |
| 50 | + - name: 🖤 Create artifact |
| 51 | + uses: 'actions/upload-artifact@v2' |
| 52 | + with: |
| 53 | + name: "v${{ env.VERSION }}-${{ github.sha }}-JDK${{ env.JAVA_VERSION }}" |
| 54 | + path: '${{ GITHUB.WORKSPACE }}/DownloadArtifact/*' |
| 55 | + retention-days: 7 |
| 56 | + if-no-files-found: error |
| 57 | + |
| 58 | + java_11: |
| 59 | + name: 🔥 Build [Java 11] |
| 60 | + runs-on: ubuntu-latest |
| 61 | + env: |
| 62 | + JAVA_VERSION: 11 |
| 63 | + steps: |
| 64 | + |
| 65 | + - uses: actions/checkout@v2 |
| 66 | + |
| 67 | + - name: ❤️ Set up Java ${{ env.JAVA_VERSION }} |
| 68 | + uses: actions/setup-java@v2 |
| 69 | + with: |
| 70 | + java-version: ${{ env.JAVA_VERSION }} |
| 71 | + distribution: 'adopt' |
| 72 | + architecture: x64 |
| 73 | + |
| 74 | + - name: 🍎 Cache the Maven packages to speed up build |
| 75 | + uses: actions/cache@v1 |
| 76 | + with: |
| 77 | + path: ~/.m2 |
| 78 | + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| 79 | + restore-keys: ${{ runner.os }}-m2 |
| 80 | + |
| 81 | + - name: 😎 Create artifact directory |
| 82 | + run: mkdir ${{ GITHUB.WORKSPACE }}/DownloadArtifact |
| 83 | + |
| 84 | + - name: 💻 Build Protocol |
| 85 | + run: | |
| 86 | + cd Protocol |
| 87 | + mvn clean install -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e |
| 88 | + mvn -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e package --file pom.xml |
| 89 | + |
| 90 | + - name: 💻 Build BungeeCord |
| 91 | + run: | |
| 92 | + cd BungeeCord |
| 93 | + mvn clean install -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e |
| 94 | + mvn -Dcompile.output=${{ GITHUB.WORKSPACE }}/DownloadArtifact -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e package --file pom.xml |
| 95 | + |
| 96 | + - name: 💻 Build Spigot |
| 97 | + run: | |
| 98 | + cd Spigot |
| 99 | + mvn clean install -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e |
| 100 | + mvn -Dcompile.output=${{ GITHUB.WORKSPACE }}/DownloadArtifact -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e package --file pom.xml |
| 101 | + |
| 102 | + - name: 🖤 Create artifact |
| 103 | + uses: 'actions/upload-artifact@v2' |
| 104 | + with: |
| 105 | + name: "v${{ env.VERSION }}-${{ github.sha }}-JDK${{ env.JAVA_VERSION }}" |
| 106 | + path: '${{ GITHUB.WORKSPACE }}/DownloadArtifact/*' |
| 107 | + retention-days: 7 |
| 108 | + if-no-files-found: error |
| 109 | + |
| 110 | + java_16: |
| 111 | + name: 🔥 Build [Java 16] |
| 112 | + runs-on: ubuntu-latest |
| 113 | + env: |
| 114 | + JAVA_VERSION: 16 |
| 115 | + steps: |
| 116 | + |
| 117 | + - uses: actions/checkout@v2 |
| 118 | + |
| 119 | + - name: ❤️ Set up Java ${{ env.JAVA_VERSION }} |
| 120 | + uses: actions/setup-java@v2 |
| 121 | + with: |
| 122 | + java-version: ${{ env.JAVA_VERSION }} |
| 123 | + distribution: 'adopt' |
| 124 | + architecture: x64 |
| 125 | + |
| 126 | + - name: 🍎 Cache the Maven packages to speed up build |
| 127 | + uses: actions/cache@v1 |
| 128 | + with: |
| 129 | + path: ~/.m2 |
| 130 | + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| 131 | + restore-keys: ${{ runner.os }}-m2 |
| 132 | + |
| 133 | + - name: 😎 Create artifact directory |
| 134 | + run: mkdir ${{ GITHUB.WORKSPACE }}/DownloadArtifact |
| 135 | + |
| 136 | + - name: 💻 Build Protocol |
| 137 | + run: | |
| 138 | + cd Protocol |
| 139 | + mvn clean install -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e |
| 140 | + mvn -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e package --file pom.xml |
| 141 | + |
| 142 | + - name: 💻 Build BungeeCord |
| 143 | + run: | |
| 144 | + cd BungeeCord |
| 145 | + mvn clean install -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e |
| 146 | + mvn -Dcompile.output=${{ GITHUB.WORKSPACE }}/DownloadArtifact -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e package --file pom.xml |
| 147 | + |
| 148 | + - name: 💻 Build Spigot |
| 149 | + run: | |
| 150 | + cd Spigot |
| 151 | + mvn clean install -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e |
| 152 | + mvn -Dcompile.output=${{ GITHUB.WORKSPACE }}/DownloadArtifact -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e package --file pom.xml |
| 153 | + |
| 154 | + - name: 🖤 Create artifact |
| 155 | + uses: 'actions/upload-artifact@v2' |
| 156 | + with: |
| 157 | + name: "v${{ env.VERSION }}-${{ github.sha }}-JDK${{ env.JAVA_VERSION }}" |
| 158 | + path: '${{ GITHUB.WORKSPACE }}/DownloadArtifact/*' |
| 159 | + retention-days: 7 |
| 160 | + if-no-files-found: error |
| 161 | + |
| 162 | + java_17: |
| 163 | + name: 🔥 Build [Java 17] |
| 164 | + runs-on: ubuntu-latest |
| 165 | + env: |
| 166 | + JAVA_VERSION: 17 |
| 167 | + steps: |
| 168 | + |
| 169 | + - uses: actions/checkout@v2 |
| 170 | + |
| 171 | + - name: ❤️ Set up Java ${{ env.JAVA_VERSION }} |
| 172 | + uses: actions/setup-java@v2 |
| 173 | + with: |
| 174 | + java-version: ${{ env.JAVA_VERSION }} |
| 175 | + distribution: 'adopt' |
| 176 | + architecture: x64 |
| 177 | + |
| 178 | + - name: 🍎 Cache the Maven packages to speed up build |
| 179 | + uses: actions/cache@v1 |
| 180 | + with: |
| 181 | + path: ~/.m2 |
| 182 | + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| 183 | + restore-keys: ${{ runner.os }}-m2 |
| 184 | + |
| 185 | + - name: 😎 Create artifact directory |
| 186 | + run: mkdir ${{ GITHUB.WORKSPACE }}/DownloadArtifact |
| 187 | + |
| 188 | + - name: 💻 Build Protocol |
| 189 | + run: | |
| 190 | + cd Protocol |
| 191 | + mvn clean install -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e |
| 192 | + mvn -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e package --file pom.xml |
| 193 | + |
| 194 | + - name: 💻 Build BungeeCord |
| 195 | + run: | |
| 196 | + cd BungeeCord |
| 197 | + mvn clean install -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e |
| 198 | + mvn -Dcompile.output=${{ GITHUB.WORKSPACE }}/DownloadArtifact -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e package --file pom.xml |
| 199 | + |
| 200 | + - name: 💻 Build Spigot |
| 201 | + run: | |
| 202 | + cd Spigot |
| 203 | + mvn clean install -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e |
| 204 | + mvn -Dcompile.output=${{ GITHUB.WORKSPACE }}/DownloadArtifact -Dcompile.java_version=${{ env.JAVA_VERSION }} -Dcompile.version=v${{ env.VERSION }}-${{ github.sha }} -B -e package --file pom.xml |
| 205 | + |
| 206 | + - name: 🖤 Create artifact |
| 207 | + uses: 'actions/upload-artifact@v2' |
| 208 | + with: |
| 209 | + name: "v${{ env.VERSION }}-${{ github.sha }}-JDK${{ env.JAVA_VERSION }}" |
| 210 | + path: '${{ GITHUB.WORKSPACE }}/DownloadArtifact/*' |
| 211 | + retention-days: 7 |
| 212 | + if-no-files-found: error |
0 commit comments