Skip to content

Commit 46d3858

Browse files
authored
ci: allow release build via workflow_dispatch (#18)
The Release workflow only triggered on `push: tags`, but release-please creates tags with the default GITHUB_TOKEN, which does not trigger downstream workflows. As a result no binary/Homebrew formula has been published since v0.2.0. Add a workflow_dispatch input (tag) and use it for checkout ref, version, and the release upload target so any tag can be (re)built manually.
1 parent 8b00c5a commit 46d3858

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,27 @@ on:
44
push:
55
tags:
66
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: "Tag to build and publish (e.g. v0.3.2)"
11+
required: true
12+
type: string
713

814
jobs:
915
build:
1016
name: Build macOS binary
1117
runs-on: macos-26
1218
permissions:
1319
contents: write
20+
env:
21+
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
1422

1523
steps:
1624
- name: Checkout
1725
uses: actions/checkout@v4
26+
with:
27+
ref: ${{ inputs.tag || github.ref_name }}
1828

1929
- name: Select Xcode
2030
uses: maxim-lobanov/setup-xcode@v1
@@ -28,7 +38,7 @@ jobs:
2838
2939
- name: Create tarball
3040
run: |
31-
VERSION="${GITHUB_REF_NAME}"
41+
VERSION="${RELEASE_TAG}"
3242
tar -czf "mocker-${VERSION}-arm64-apple-macosx.tar.gz" \
3343
-C .build/release mocker
3444
echo "TARBALL=mocker-${VERSION}-arm64-apple-macosx.tar.gz" >> $GITHUB_ENV
@@ -43,6 +53,7 @@ jobs:
4353
- name: Upload binary to release
4454
uses: softprops/action-gh-release@v2
4555
with:
56+
tag_name: ${{ inputs.tag || github.ref_name }}
4657
files: ${{ env.TARBALL }}
4758

4859
- name: Update Homebrew formula

0 commit comments

Comments
 (0)