Support for latest Gayser. #50
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: Publish | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths-ignore: | |
| - '.gitignore' | |
| - 'LICENSE' | |
| - 'README.md' | |
| - 'gradle.yml' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Change wrapper permissions | |
| run: chmod +x ./gradlew | |
| - uses: gradle/actions/wrapper-validation@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 21 | |
| - name: Get previous build number | |
| id: getPreviousBuild | |
| run: | | |
| PREVIOUS_TAG=$(git for-each-ref --sort=-version:refname --count 1 --format="%(refname:short)" "refs/tags/*") | |
| echo result=${PREVIOUS_TAG} >> $GITHUB_OUTPUT | |
| - name: Get current build number | |
| id: getCurrentBuild | |
| if: success() | |
| env: | |
| PREVIOUS_BUILD: ${{ steps.getPreviousBuild.outputs.result }} | |
| run: echo result=$((++PREVIOUS_BUILD)) >> $GITHUB_OUTPUT | |
| - name: Build Project | |
| run: ./gradlew shadowJar | |
| - name: Bump version and push tag | |
| id: tag_version | |
| uses: mathieudutour/github-tag-action@v6.2 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| tag_prefix: '' | |
| custom_tag: ${{ steps.getCurrentBuild.outputs.result }} | |
| - name: Generate release diff | |
| env: | |
| BEGIN_COMMIT: ${{ steps.getPreviousBuild.outputs.result }} | |
| END_COMMIT: ${{ steps.getCurrentBuild.outputs.result }} | |
| run: git fetch --tags --force && git log --pretty=format:"* %s (%h)" ${BEGIN_COMMIT}..${END_COMMIT} > release_notes.md | |
| - name: Create release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "build/libs/geyserreversion.jar" | |
| allowUpdates: true | |
| bodyFile: "release_notes.md" | |
| draft: false | |
| prerelease: false | |
| name: Build ${{ steps.getCurrentBuild.outputs.result }} (${{ github.ref_name }}) | |
| tag: ${{ steps.getCurrentBuild.outputs.result }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Artifacts to GitHub | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Artifacts | |
| path: build/libs/ | |
| if-no-files-found: error | |
| - name: Publish to Modrinth | |
| env: | |
| MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | |
| BUILD_NUMBER: ${{ steps.getCurrentBuild.outputs.result }} | |
| run: ./gradlew modrinth |