From 37322f74046d5b6dc656ebd95614a3acbaf11dc2 Mon Sep 17 00:00:00 2001 From: Viktor Erlingsson Date: Wed, 21 Jan 2026 14:56:23 +0100 Subject: [PATCH] Move static package build to separate workflow Split the release workflow into two parts: - release.yml: Creates the GitHub release with notes - static-release.yml: Builds and uploads static tar packages The static-release workflow triggers on release publish, ensuring packages are built and uploaded after the release is created. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/release.yml | 22 ++--------------- .github/workflows/static-release.yml | 37 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/static-release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e0c309f..7809a12 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: name: Create Release jobs: - build: + release: name: Create Release runs-on: ubuntu-latest steps: @@ -16,25 +16,7 @@ jobs: with: fetch-depth: 0 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build static tar package - uses: docker/build-push-action@v6 - with: - file: tar.Dockerfile - platforms: linux/amd64,linux/arm64 - outputs: . - cache-from: type=gha,scope=release - cache-to: type=gha,mode=max,scope=release - - - name: List files - run: ls -Rl - - name: Create Release - run: gh release create "${{ github.ref }}" ./**/*.tar.gz --notes "$(./build/release_notes)" + run: gh release create "${{ github.ref }}" --notes "$(./build/release_notes)" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/static-release.yml b/.github/workflows/static-release.yml new file mode 100644 index 0000000..717f29a --- /dev/null +++ b/.github/workflows/static-release.yml @@ -0,0 +1,37 @@ +name: Upload static packages to release + +on: + release: + types: [published] + +jobs: + static: + name: Build and upload static packages + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + ref: ${{ github.event.release.tag_name }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build static tar package + uses: docker/build-push-action@v6 + with: + file: tar.Dockerfile + platforms: linux/amd64,linux/arm64 + outputs: builds + cache-from: type=gha,scope=static-release + cache-to: type=gha,mode=max,scope=static-release + + - name: Upload to release + run: gh release upload "${{ github.event.release.tag_name }}" builds/**/*.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}