Bump mod version #33
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: Build Mod | |
| on: [push, pull_request] | |
| jobs: | |
| buildJar: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up PATH | |
| run: | | |
| echo "${ANDROID_HOME}/build-tools/34.0.0" >> $GITHUB_PATH | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: adopt | |
| - name: Build mod jar | |
| run: ./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: Read version from file | |
| id: read_version_from_file | |
| run: | | |
| echo "ver=$(sed -nE 's/^version: \s*(\S*)\s*$/v\1/p' mod.hjson)" >> $GITHUB_OUTPUT | |
| - name: Automatic release (Current version) | |
| uses: "marvinpinto/action-automatic-releases@latest" | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| automatic_release_tag: "${{ steps.read_version_from_file.outputs.ver }}" | |
| prerelease: false | |
| title: "${{ steps.read_version_from_file.outputs.ver }} (Mindustry v8)" | |
| files: | | |
| ./build/libs/*.jar | |
| - name: Automatic release (Latest) | |
| uses: "marvinpinto/action-automatic-releases@latest" | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| automatic_release_tag: "latest" | |
| prerelease: false | |
| title: "Latest Build (Mindustry v8)" | |
| files: | | |
| ./build/libs/*.jar |