build: ahh root group refactor #504
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Commit Testing and Tag Publishing | |
| on: [push] | |
| jobs: | |
| buildJar: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up PATH | |
| run: | | |
| echo "${ANDROID_HOME}/build-tools/34.0.0" >> $GITHUB_PATH | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v1 | |
| with: | |
| java-version: 17 | |
| - name: Build mod jar | |
| run: | | |
| chmod +x ./gradlew | |
| ./gradlew deploy | |
| - name: Upload built jar file | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ github.event.repository.name }} | |
| path: build/libs/${{ github.event.repository.name }}.jar | |
| - name: Get version | |
| id: get_version | |
| run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
| - name: Extract min game version | |
| id: get_game_ver | |
| run: | | |
| MIN_VER=$(grep 'minGameVersion' mod.hjson | sed 's/.*:[[:space:]]*//') | |
| echo "min_game_version=$MIN_VER" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.get_version.outputs.VERSION }} | |
| release_name: ${{ steps.get_version.outputs.VERSION }} | |
| draft: false | |
| prerelease: false | |
| - name: Upload Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: build/libs/${{ github.event.repository.name }}.jar | |
| asset_name: ${{ github.event.repository.name }}.${{ steps.get_version.outputs.VERSION }}-${{ steps.get_game_ver.outputs.min_game_version }}.jar | |
| asset_content_type: application/java-archive | |
| buildWindows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v1 | |
| with: | |
| java-version: 17 | |
| - name: Build mod jar | |
| run: ./gradlew jar |