From 7cf3baebed1e22cd59b9b1885a47641bef120dd3 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Tue, 2 Dec 2025 12:23:14 +0100 Subject: [PATCH] ci: add manual trigger for build workflow --- .github/workflows/build-binaries.yml | 40 +++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index d9b38c27..8ab563b8 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -4,6 +4,12 @@ on: push: tags: - 'v*' + workflow_dispatch: + inputs: + tag: + description: 'Tag to build (e.g., v0.12.0)' + required: true + type: string permissions: contents: write @@ -11,9 +17,13 @@ permissions: jobs: build: runs-on: ubuntu-latest + env: + RELEASE_TAG: ${{ github.event.inputs.tag || github.ref_name }} steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ env.RELEASE_TAG }} - name: Setup Bun uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1 @@ -83,14 +93,38 @@ jobs: # Windows x64 (zip) zip -r pi-windows-x64.zip pi-windows-x64.exe package.json README.md CHANGELOG.md theme/ - - name: Upload to GitHub Release + - name: Extract changelog for this version + id: changelog + run: | + VERSION="${RELEASE_TAG}" + VERSION="${VERSION#v}" # Remove 'v' prefix + + # Extract changelog section for this version + cd packages/coding-agent + awk "/^## \[${VERSION}\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md > /tmp/release-notes.md + + # If empty, use a default message + if [ ! -s /tmp/release-notes.md ]; then + echo "Release ${VERSION}" > /tmp/release-notes.md + fi + + - name: Create GitHub Release and upload binaries env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cd packages/coding-agent/binaries - # Upload all archives to the release - gh release upload "${{ github.ref_name }}" \ + # Create release with changelog notes (or update if exists) + gh release create "${RELEASE_TAG}" \ + --title "${RELEASE_TAG}" \ + --notes-file /tmp/release-notes.md \ + pi-darwin-arm64.tar.gz \ + pi-darwin-x64.tar.gz \ + pi-linux-x64.tar.gz \ + pi-linux-arm64.tar.gz \ + pi-windows-x64.zip \ + 2>/dev/null || \ + gh release upload "${RELEASE_TAG}" \ pi-darwin-arm64.tar.gz \ pi-darwin-x64.tar.gz \ pi-linux-x64.tar.gz \