feat: release pipeline and env-supplied server key (#82)

* build: move group and version to gradle.properties

* ci: add release-please versioning and release pipeline

* feat(server): load the root key from the environment

* ci: publish key-free server archives on release
This commit is contained in:
Fiereu authored and GitHub committed 2026-08-03 11:38:03 +02:00
1 parent 8bd065fcb4
commit dfeabdc581
20 files changed
+291 -33

No files matched your search

+26 -3
View File
@@ -13,6 +13,28 @@ concurrency:
cancel-in-progress: true
jobs:
pr-title:
name: Conventional PR title
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check the title against the Conventional Commits spec
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
types='build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test'
if [[ "$PR_TITLE" =~ ^($types)(\([a-z0-9._/-]+\))?!?:\ .+ ]]; then
echo "OK: $PR_TITLE"
exit 0
fi
echo "::error::PR title is not a Conventional Commit: $PR_TITLE"
echo "Expected '<type>(<optional scope>): <description>', for example:"
echo " feat(game): start a wild battle when a player steps in grass"
echo " fix(codegen): merge the duplicate branches in the text parser"
echo "Valid types: ${types//|/, }"
echo "Append '!' after the type or scope to mark a breaking change."
exit 1
ci:
name: Spotless and check
runs-on: ubuntu-latest
@@ -37,9 +59,10 @@ jobs:
- name: Apply Spotless and push formatting changes
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.user.login != 'renovate[bot]'
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.user.login != 'renovate[bot]' &&
!startsWith(github.head_ref, 'release-please--')
run: |
./gradlew spotlessApply
if git diff --quiet; then
+76
View File
@@ -0,0 +1,76 @@
name: Release
on:
push:
branches: [ "master" ]
permissions:
contents: write
pull-requests: write
issues: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
release-please:
name: Prepare release
runs-on: ubuntu-latest
outputs:
released: ${{ steps.release.outputs.releases_created }}
tag: ${{ steps.release.outputs.tag_name }}
steps:
- name: Run release-please
id: release
uses: googleapis/release-please-action@v4
with:
# A PAT is needed for CI to run on the release pull request.
token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
publish:
name: Publish server distributions
needs: release-please
if: needs.release-please.outputs.released == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout the release tag
uses: actions/checkout@v7
with:
ref: ${{ needs.release-please.outputs.tag }}
submodules: recursive
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "25"
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
# No ROMs on the runner, so dialog ids are placeholders.
- name: Build distributions
run: ./gradlew :server.login:assembleDist :server.game:assembleDist
- name: Check no keys are bundled
run: |
found=$(tar -tf server.login/build/distributions/*.tar \
&& tar -tf server.game/build/distributions/*.tar)
if grep -q '\.pem$' <<<"$found"; then
echo "::error::a distribution bundles a key"
grep '\.pem$' <<<"$found"
exit 1
fi
echo "No keys in the distributions."
- name: Attach distributions to the release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ needs.release-please.outputs.tag }}" \
server.login/build/distributions/* \
server.game/build/distributions/* \
--clobber