From 450f715874df0f19f1eccf886d4df0da67aa901c Mon Sep 17 00:00:00 2001 From: KoalaDev <6156589+Shik3i@users.noreply.github.com> Date: Fri, 19 Jun 2026 10:59:30 +0200 Subject: [PATCH] ci(release): update actions to Node 24 versions & optimize workflow - Bump all actions off the deprecated Node 20 runtime: checkout v4->v7, upload-artifact v4->v7, setup-node added@v6, action-gh-release v1->v3, docker build-push v5->v7, login v3->v4, metadata v5->v6, buildx v3->v4 (verified latest majors via GitHub API; no breaking input/output changes) - Add npm dependency caching via setup-node (cache: npm) - Add GHA layer caching for the multi-arch Docker build (cache-from/to gha) - Add concurrency group so a release run is never interrupted, only dedupes re-pushes of the same tag - Tighten release-server permissions to contents: read (it never writes to the repo) Version-injection and commit-back logic unchanged. First exercised on the next v* tag. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/release.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd39159..d2314cd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,23 +5,29 @@ on: tags: - 'v*' +# A release run must never be interrupted (it commits back to main and publishes +# artifacts). Only dedupe accidental re-pushes of the same tag. +concurrency: + group: release-${{ github.ref_name }} + cancel-in-progress: false + jobs: release-server: runs-on: ubuntu-latest permissions: - contents: write + contents: read packages: write id-token: write attestations: write steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: ghcr.io username: ${{ github.actor }} @@ -29,7 +35,7 @@ jobs: - name: Extract Docker metadata id: meta - uses: docker/metadata-action@v5 + uses: docker/metadata-action@v6 with: images: ghcr.io/${{ github.repository }} tags: | @@ -38,7 +44,7 @@ jobs: - name: Build and push Docker image id: build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v7 with: context: . file: server/Dockerfile @@ -46,6 +52,9 @@ jobs: platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + # Reuse layers across releases to speed up the multi-arch build. + cache-from: type=gha + cache-to: type=gha,mode=max - name: Generate artifact attestation uses: actions/attest@v4 @@ -62,7 +71,13 @@ jobs: attestations: write steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v7 + + - name: Set up Node.js + uses: actions/setup-node@v6 + with: + node-version: '24' + cache: 'npm' - name: Extract version from tag id: version @@ -128,14 +143,14 @@ jobs: run: node website/build.cjs - name: Upload Website Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: website-www path: website/www/ if-no-files-found: error - name: Create GitHub Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v3 with: files: | dist/koalasync-chrome.zip