Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/docker-gradle-build-push.yml
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Propagate the release version into Gradle

This Gradle invocation never receives versionOverride; with gg.grounds.base-conventions 0.6.0, project.version defaults to local-SNAPSHOT unless that property is set, and the Velocity conventions bake project.version into BuildInfo.VERSION. On v* image releases, GHCR will get a semver tag but the JAR's Velocity plugin metadata and permission-catalog source version will still be local-SNAPSHOT, so the tag version needs to be passed into the Docker build and then into this Gradle command.

Useful? React with πŸ‘Β / πŸ‘Ž.

-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.