Release LITIENGINE #953
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: Release LITIENGINE | |
| on: | |
| push: | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+' | |
| workflow_dispatch: | |
| inputs: | |
| incrementVersion: | |
| type: choice | |
| description: "increment version?" | |
| required: true | |
| default: 'none' | |
| options: | |
| - none | |
| - patch | |
| - minor | |
| - major | |
| schedule: | |
| # Midnight every day | |
| - cron: "0 0 * * *" | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Release build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: read | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: JDK Setup | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 25 | |
| - name: Gradle Setup | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Increment version | |
| if: inputs.incrementVersion != 'none' && inputs.incrementVersion != '' | |
| env: | |
| GRGIT_USER: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| ./gradlew incrementVersion --increment=${{inputs.incrementVersion}} | |
| ./gradlew pushTags | |
| latest_tag=$(git describe --tags --abbrev=0) | |
| echo "RELEASE_VERSION=$latest_tag" >> "$GITHUB_ENV" | |
| - name: Update CITATION.cff | |
| if: inputs.incrementVersion != 'none' && inputs.incrementVersion != '' | |
| run: | | |
| release_date=$(date +'%Y-%m-%d') | |
| sed -i "s/^version: .*/version: $RELEASE_VERSION/" CITATION.cff | |
| sed -i "s/^date-released: .*/date-released: '$release_date'/" CITATION.cff | |
| - name: Commit CITATION.cff | |
| if: inputs.incrementVersion != 'none' && inputs.incrementVersion != '' | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| message: "Update CITATION.cff for release $RELEASE_VERSION" | |
| committer_name: GitHub Actions | |
| committer_email: [email protected] | |
| add: 'CITATION.cff' | |
| - name: Publish | |
| env: | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.PGP_SECRET }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.PGP_PASSPHRASE }} | |
| run: ./gradlew publish | |
| - name: Create release notes | |
| if: inputs.incrementVersion != 'none' && inputs.incrementVersion != '' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ github.ref_name }} | |
| run: | | |
| gh release create "$RELEASE_VERSION" \ | |
| --repo="$GITHUB_REPOSITORY" \ | |
| --title="$RELEASE_VERSION" \ | |
| --generate-notes \ | |
| --draft | |
| - name: Announce release | |
| if: inputs.incrementVersion != 'none' && inputs.incrementVersion != '' | |
| run: | | |
| curl -X POST -H "Authorization: Bearer ${{ secrets.MASTODON_ACCESS_TOKEN }}" \ | |
| -F "status=#LITIENGINE version ${{ env.RELEASE_VERSION }} has just been released! | |
| #GameDev #indiedev #videogames #IndieGameDev | |
| ${{ github.server_url }}/${{ github.repository }}/releases/tag/$RELEASE_VERSION" \ | |
| https://fosstodon.org/api/v1/statuses | |
| package: | |
| name: Package distribution | |
| if: inputs.incrementVersion != 'none' && inputs.incrementVersion != '' | |
| needs: release | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest, macos-latest, windows-latest ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 24 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Package | |
| shell: bash | |
| run: | | |
| latest_tag=$(git describe --tags --abbrev=0) | |
| echo "RELEASE_VERSION=$latest_tag" >> "$GITHUB_ENV" | |
| ./gradlew jpackage -Prelease=true | |
| - name: Upload package | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: utiLITI-${{ runner.os }} | |
| path: utiliti/build/jpackage | |
| - name: Set up Butler | |
| if: runner.arch == 'X64' | |
| uses: jdno/setup-butler@v1 | |
| - name: Upload to itch.io | |
| if: runner.arch == 'X64' | |
| env: | |
| BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }} | |
| run: | | |
| butler push utiliti/build/jpackage gurkenlabs/litiengine:${{ runner.os }} --userversion ${{ env.RELEASE_VERSION }} |