File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 push :
55 tags :
66 - " v*"
7+ release :
8+ types :
9+ - published
710 workflow_dispatch :
811 inputs :
912 tag :
@@ -28,12 +31,27 @@ jobs:
2831 env :
2932 BINARY : ts-harness
3033 GH_TOKEN : ${{ github.token }}
31- RELEASE_TAG : ${{ inputs.tag || github.ref_name }}
34+ RELEASE_TAG : ${{ github.event.release.tag_name || inputs.tag || github.ref_name }}
3235 TARGET : ${{ matrix.target }}
3336 steps :
3437 - name : Checkout code
3538 uses : actions/checkout@v6
3639
40+ - name : Ensure release tag
41+ if : github.event_name == 'workflow_dispatch'
42+ shell : bash
43+ run : |
44+ set -euo pipefail
45+ case "$RELEASE_TAG" in
46+ v*) ;;
47+ *) echo "release tag must start with v: $RELEASE_TAG" >&2; exit 2 ;;
48+ esac
49+ git fetch --tags --force
50+ if ! git rev-parse -q --verify "refs/tags/${RELEASE_TAG}" >/dev/null; then
51+ git tag "$RELEASE_TAG" "$GITHUB_SHA"
52+ git push origin "refs/tags/${RELEASE_TAG}"
53+ fi
54+
3755 - name : Setup Node.js
3856 uses : actions/setup-node@v6
3957 with :
You can’t perform that action at this time.
0 commit comments