From 3b570afd9799b6af41dab48e566302350a6b4568 Mon Sep 17 00:00:00 2001 From: Lukas Jost Date: Mon, 13 Jul 2026 20:30:14 +0200 Subject: [PATCH] feat: publish permissions plugin image --- .../workflows/docker-gradle-build-push.yml | 22 +++++++++++ Dockerfile | 39 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/docker-gradle-build-push.yml create mode 100644 Dockerfile diff --git a/.github/workflows/docker-gradle-build-push.yml b/.github/workflows/docker-gradle-build-push.yml new file mode 100644 index 0000000..4aad660 --- /dev/null +++ b/.github/workflows/docker-gradle-build-push.yml @@ -0,0 +1,22 @@ +name: Docker Build + +# Publishes ghcr.io/groundsgg/plugin-permissions (edge on main, semver on tag). +# The image carries the shaded Velocity JAR at /jar/plugin.jar for the +# plugin-velocity-jar Helm chart. + +on: + push: + branches: + - main + tags: + - "v*" + pull_request: + +permissions: + packages: write + contents: write + actions: write + +jobs: + reusable: + uses: groundsgg/.github/.github/workflows/docker-gradle-build-push.yml@main diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eac08c4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +# syntax=docker/dockerfile:1 +# +# Builds the plugin-permissions Velocity-plugin JAR and packages it for the +# platform-test environment. The output image carries the JAR at +# /jar/plugin.jar — the shape the `plugin-velocity-jar` Helm chart expects. +# +# Pushed as `ghcr.io/groundsgg/plugin-permissions:edge` (main) or with a +# semantic version tag by .github/workflows/docker-gradle-build-push.yml. + +FROM eclipse-temurin:25-jdk AS build +WORKDIR /src + +# GitHub Packages credentials for the Grounds Gradle convention plugins. +# The token is supplied as a BuildKit secret so it is not stored in a layer. +ARG GITHUB_USER + +COPY gradle/ gradle/ +COPY gradlew settings.gradle.kts build.gradle.kts ./ + +COPY common/ common/ +COPY minestom/ minestom/ +COPY velocity/ velocity/ + +RUN --mount=type=secret,id=github_token,required=true \ + /bin/sh -euc '\ + : "${GITHUB_USER:?GITHUB_USER build arg is required}"; \ + token="$(cat /run/secrets/github_token)"; \ + ./gradlew --no-daemon :velocity:build \ + -Pgithub.user="${GITHUB_USER}" \ + -Pgithub.token="${token}" \ + ' + +RUN mkdir -p /out && \ + cp "$(ls -S /src/velocity/build/libs/*.jar | head -n1)" /out/plugin.jar + +FROM alpine:3 +RUN mkdir -p /jar +COPY --from=build /out/plugin.jar /jar/plugin.jar +# No ENTRYPOINT: the plugin-velocity-jar chart copies the JAR from this image.