# Builds and publishes a release when a version tag is pushed: # git tag v0.2.1 && git push origin v0.2.1 # The release gets the four packages (full/launcher x Windows/Linux), SHA256SUMS.txt and the # matching CHANGELOG.md section as its text. Tests that need the game CD skip themselves here. # # Needs: Gitea Actions enabled and a runner with the label "ubuntu-latest" (act_runner). # The built-in token is used; if it may not create releases on your instance, add a repository # secret RELEASE_TOKEN (a token with write access to the repository). name: release on: push: tags: - 'v*' jobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: JDK 25 (toolchain) and 21 (runs Gradle) uses: actions/setup-java@v4 with: distribution: temurin java-version: | 25 21 - name: Version from the tag run: | V="${GITHUB_REF_NAME#v}" echo "VERSION=$V" >> "$GITHUB_ENV" python3 tools/release/changelog_section.py "$V" > release-notes.md echo "Release $V"; head -5 release-notes.md - name: Build, test and package run: | ./gradlew --no-daemon \ -Porg.gradle.java.installations.fromEnv=JAVA_HOME_25_X64 \ -Porg.gradle.java.installations.auto-download=false \ -PreleaseVersion="$VERSION" \ build packageAll - name: Checksums run: | cd build/dist ls -la sha256sum LlamaMod-"$VERSION"-*.zip LlamaMod-"$VERSION"-*.tar.gz > SHA256SUMS.txt cat SHA256SUMS.txt - name: Publish env: GITEA_URL: ${{ github.server_url }} GITEA_REPO: ${{ github.repository }} GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN || github.token }} run: | python3 tools/release/publish_gitea.py \ --tag "$GITHUB_REF_NAME" --title "LlamaMod $VERSION" --notes release-notes.md \ build/dist/LlamaMod-"$VERSION"-*.zip build/dist/LlamaMod-"$VERSION"-*.tar.gz \ build/dist/SHA256SUMS.txt