feat(server): make both servers deployable as container images (#147)

This commit is contained in:
LananaHWP authored and GitHub committed 2026-08-10 17:05:02 +02:00
1 parent 70449971cb
commit aba1226794
33 files changed
+825 -40

No files matched your search

+63 -11
View File
@@ -31,10 +31,13 @@ jobs:
manifest-file: .release-please-manifest.json
publish:
name: Publish server distributions
name: Publish server distributions and images
needs: release-please
if: needs.release-please.outputs.released == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout the release tag
uses: actions/checkout@v7
@@ -53,19 +56,14 @@ jobs:
# No ROMs on the runner, so dialog ids are placeholders.
- name: Build distributions
run: ./gradlew :server.login:assembleDist :server.game:assembleDist
run: >
./gradlew :server.login:assembleDist :server.game:assembleDist
:server.login:installDist :server.game:installDist
- 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."
run: bash .github/scripts/check-no-keys.sh
# Before the images, so a registry failure cannot leave a tagged release with no archives.
- name: Attach distributions to the release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -74,3 +72,57 @@ jobs:
server.login/build/distributions/* \
server.game/build/distributions/* \
--clobber
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to the GitHub container registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Describe the login server image
id: login-image
uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository_owner }}/openmmo-login
flavor: latest=true
labels: org.opencontainers.image.title=OpenMMO login server
annotations: org.opencontainers.image.title=OpenMMO login server
tags: |
type=semver,pattern={{version}},value=${{ needs.release-please.outputs.tag }}
type=semver,pattern={{major}}.{{minor}},value=${{ needs.release-please.outputs.tag }}
- name: Publish the login server image
uses: docker/build-push-action@v7
with:
context: .
file: server.login/Dockerfile
push: true
tags: ${{ steps.login-image.outputs.tags }}
labels: ${{ steps.login-image.outputs.labels }}
annotations: ${{ steps.login-image.outputs.annotations }}
- name: Describe the game server image
id: game-image
uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository_owner }}/openmmo-game
flavor: latest=true
labels: org.opencontainers.image.title=OpenMMO game server
annotations: org.opencontainers.image.title=OpenMMO game server
tags: |
type=semver,pattern={{version}},value=${{ needs.release-please.outputs.tag }}
type=semver,pattern={{major}}.{{minor}},value=${{ needs.release-please.outputs.tag }}
- name: Publish the game server image
uses: docker/build-push-action@v7
with:
context: .
file: server.game/Dockerfile
push: true
tags: ${{ steps.game-image.outputs.tags }}
labels: ${{ steps.game-image.outputs.labels }}
annotations: ${{ steps.game-image.outputs.annotations }}