From 83d5d047576512da0e66591df583b05d67fcf911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Thu, 9 Jul 2026 16:20:26 +0200 Subject: [PATCH] ci(release): support manual release artifact publishing --- .github/workflows/release-please.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 3d50736..13c82fa 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -4,10 +4,21 @@ on: push: branches: - main + workflow_dispatch: + inputs: + tag_name: + description: Existing release tag to publish artifacts for + required: true + type: string + ref: + description: Git ref to build, defaults to tag_name + required: false + type: string jobs: release-please: runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' }} permissions: contents: write pull-requests: write @@ -26,7 +37,7 @@ jobs: name: Build and publish release artifacts runs-on: ubuntu-latest needs: release-please - if: ${{ needs.release-please.outputs.release_created == 'true' }} + if: ${{ always() && (github.event_name == 'workflow_dispatch' || needs.release-please.outputs.release_created == 'true') }} permissions: artifact-metadata: write attestations: write @@ -34,6 +45,8 @@ jobs: id-token: write steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + ref: ${{ inputs.ref || inputs.tag_name || github.ref }} - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 with: @@ -62,21 +75,23 @@ jobs: bun build --compile --target=bun-linux-x64 src/cli.ts --outfile ../dist/altertable-linux-x64 bun build --compile --target=bun-linux-arm64 src/cli.ts --outfile ../dist/altertable-linux-arm64 cp dist/cli.js ../dist/altertable-cli.js - cd ../dist && shasum -a 256 altertable-* altertable-cli.js > checksums.txt + cd ../dist && shasum -a 256 altertable-darwin-* altertable-linux-* altertable-cli.js > checksums.txt - name: Attest release assets uses: actions/attest@a1948c3f048ba23858d222213b7c278aabede763 # v4 with: subject-path: | - dist/altertable-* + dist/altertable-darwin-* + dist/altertable-linux-* dist/altertable-cli.js dist/checksums.txt - name: Upload release assets env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_TAG: ${{ inputs.tag_name || needs.release-please.outputs.tag_name }} run: | - gh release upload "${{ needs.release-please.outputs.tag_name }}" dist/altertable-* dist/altertable-cli.js dist/checksums.txt --clobber + gh release upload "$RELEASE_TAG" dist/altertable-darwin-* dist/altertable-linux-* dist/altertable-cli.js dist/checksums.txt --clobber - name: Publish npm package env: