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