From e8e742c9e9abe42ce0b59cdfed6bede296a14a55 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Oct 2026 16:56:07 +0000 Subject: [PATCH 1/4] Initial plan From 4c109613c8a1bb6a590a4bd3c14fc774a0f9666e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Oct 2026 17:03:55 +0000 Subject: [PATCH 2/4] Automate semantic releases and manifest updates Co-authored-by: fredleger <2778741+fredleger@users.noreply.github.com> --- .github/release-drafter.yml | 35 +++++++++ .github/workflows/publish.yaml | 132 ++++++++++++++++++++++++++------- 2 files changed, 139 insertions(+), 28 deletions(-) create mode 100644 .github/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..654b38e --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,35 @@ +name-template: "$RESOLVED_VERSION" +tag-template: "$RESOLVED_VERSION" +categories: + - title: "🚀 Features" + semver-increment: minor + labels: + - feature + - enhancement + - title: "🐛 Bug fixes" + semver-increment: patch + labels: + - bug + - bugfix + - fix + - title: "🧰 Maintenance" + semver-increment: patch + labels: + - chore + - maintenance + - type: pre-exclude + labels: + - skip-changelog + - type: version-resolver + semver-increment: major + labels: + - breaking + - major + - type: version-resolver + semver-increment: patch +template: | + ## What's Changed + + $CHANGES + + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_TAG diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 5c09582..3dd1be1 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,54 +1,130 @@ -name: publish +name: Release on: - push: - tags: - - '*' + workflow_dispatch: -permissions: - actions: read - checks: write - contents: read - packages: write +permissions: {} + +concurrency: + group: release-${{ github.repository }} + cancel-in-progress: false jobs: - publish: + plan: + if: github.ref_name == github.event.repository.default_branch runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + outputs: + has-changes: ${{ steps.plan.outputs.has-changes }} + tag: ${{ steps.version.outputs.tag }} steps: - - uses: actions/checkout@v7 + - id: plan + uses: hoverkraft-tech/ci-github-publish/actions/release/plan@a0a9d185c51c10710a5987822e78feb2b5ce1932 # 0.29.0 with: - fetch-depth: 1 + github-token: ${{ github.token }} + + - id: version + env: + PLANNED_TAG: ${{ steps.plan.outputs.tag }} + run: | + if [[ ! "$PLANNED_TAG" =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then + echo "Release Drafter returned an invalid stable semantic version: $PLANNED_TAG" >&2 + exit 1 + fi - - name: Get TAG - id: get_tag - run: echo TAG=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV + major=${BASH_REMATCH[1]} + minor=${BASH_REMATCH[2]} + patch=${BASH_REMATCH[3]} + if (( major == 0 && minor < 3 || major == 0 && minor == 3 && patch < 7 )); then + PLANNED_TAG=0.3.7 + fi - - name: Get Repo Owner - id: get_repo_owner - run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV + echo "tag=$PLANNED_TAG" >> "$GITHUB_OUTPUT" + + publish-image: + needs: plan + if: needs.plan.outputs.has-changes == 'true' + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v7 + with: + ref: ${{ github.sha }} - name: Set up QEMU uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - - name: Login to Docker Registry + - name: Log in to GitHub Container Registry uses: docker/login-action@v4 with: - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ github.actor }} + password: ${{ github.token }} registry: ghcr.io - - name: Local build - id: local_build + - name: Publish multi-architecture image uses: docker/build-push-action@v7 with: build-args: | - Version=${{ env.TAG }} + Version=${{ needs.plan.outputs.tag }} GitCommit=${{ github.sha }} - outputs: "type=registry,push=true" platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: true tags: | - ghcr.io/${{ env.REPO_OWNER }}/registry-creds:${{ github.sha }} - ghcr.io/${{ env.REPO_OWNER }}/registry-creds:${{ env.TAG }} - ghcr.io/${{ env.REPO_OWNER }}/registry-creds:latest + ghcr.io/${{ github.repository }}:${{ github.sha }} + ghcr.io/${{ github.repository }}:${{ needs.plan.outputs.tag }} + ghcr.io/${{ github.repository }}:latest + + - name: Make container package public + env: + GH_TOKEN: ${{ github.token }} + run: | + package_visibility_endpoint="/orgs/${GITHUB_REPOSITORY_OWNER}/packages/container/registry-creds/visibility" + gh api --method PUT \ + "$package_visibility_endpoint" \ + -f visibility=public + + publish-release: + needs: [plan, publish-image] + if: needs.plan.outputs.has-changes == 'true' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + steps: + - uses: hoverkraft-tech/ci-github-publish/actions/release/create@a0a9d185c51c10710a5987822e78feb2b5ce1932 # 0.29.0 + with: + tag: ${{ needs.plan.outputs.tag }} + target-sha: ${{ github.sha }} + github-token: ${{ github.token }} + + update-manifests: + needs: [plan, publish-image, publish-release] + if: needs.plan.outputs.has-changes == 'true' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v7 + with: + ref: ${{ github.event.repository.default_branch }} + + - name: Update deployment manifests + env: + IMAGE: ghcr.io/${{ github.repository }} + TAG: ${{ needs.plan.outputs.tag }} + run: make shrinkwrap + + - uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@3a27d31e9ccefbe9609cc9165017ed100ff34a22 # 0.38.0 + with: + github-token: ${{ github.token }} + branch: release/update-manifest-${{ needs.plan.outputs.tag }} + title: "chore(release): update manifest for ${{ needs.plan.outputs.tag }}" + body: "Update the deployment manifest to use registry-creds ${{ needs.plan.outputs.tag }}." + commit-message: "chore(release): update manifest for ${{ needs.plan.outputs.tag }}" From e5058dc86b0d35acf52e4a65146ed515d8d8b754 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Oct 2026 17:05:05 +0000 Subject: [PATCH 3/4] Fix changelog category matching configuration Co-authored-by: fredleger <2778741+fredleger@users.noreply.github.com> --- .github/release-drafter.yml | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 654b38e..b7d6e2c 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -3,28 +3,33 @@ tag-template: "$RESOLVED_VERSION" categories: - title: "🚀 Features" semver-increment: minor - labels: - - feature - - enhancement + when: + labels: + - feature + - enhancement - title: "🐛 Bug fixes" semver-increment: patch - labels: - - bug - - bugfix - - fix + when: + labels: + - bug + - bugfix + - fix - title: "🧰 Maintenance" semver-increment: patch - labels: - - chore - - maintenance + when: + labels: + - chore + - maintenance - type: pre-exclude - labels: - - skip-changelog + when: + labels: + - skip-changelog - type: version-resolver semver-increment: major - labels: - - breaking - - major + when: + labels: + - breaking + - major - type: version-resolver semver-increment: patch template: | From 457524c63c3350d3b79beccc8e1d5c9e39ae424b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Oct 2026 17:06:48 +0000 Subject: [PATCH 4/4] Use package admin token for public GHCR visibility Co-authored-by: fredleger <2778741+fredleger@users.noreply.github.com> --- .github/workflows/publish.yaml | 7 ++++++- README.md | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 3dd1be1..a411b31 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -82,8 +82,13 @@ jobs: - name: Make container package public env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.GHCR_PACKAGE_ADMIN_TOKEN }} run: | + if [[ -z "$GH_TOKEN" ]]; then + echo "GHCR_PACKAGE_ADMIN_TOKEN is required to make the container package public." >&2 + exit 1 + fi + package_visibility_endpoint="/orgs/${GITHUB_REPOSITORY_OWNER}/packages/container/registry-creds/visibility" gh api --method PUT \ "$package_visibility_endpoint" \ diff --git a/README.md b/README.md index f91bb65..6e18fee 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,21 @@ The normal process is as follows, which becomes tedious and repetitive when you * [Install the tool](GUIDE.md) +## Releases + +Run the **Release** workflow manually from the default branch. Release Drafter +uses pull-request labels to calculate Semantic Versioning increments: +`breaking`/`major` for major releases, `feature`/`enhancement` for minor +releases, and `bug`/`bugfix`/`fix` or `chore`/`maintenance` for patch releases. +The first release is floored at `0.3.7` to avoid conflicting with upstream +versions. + +The workflow requires a `GHCR_PACKAGE_ADMIN_TOKEN` repository secret containing +a classic personal access token with package write access and permission to +change the container package visibility. GitHub Actions must also be allowed to +create and merge pull requests so the workflow can update the deployment +manifest. + ## Do you use `registry-creds`? `k3sup` was created by [Alex Ellis](https://github.com/users/alexellis/sponsorship) - the founder of [OpenFaaS ®](https://www.openfaas.com/) & [inlets](https://inlets.dev/).