Skip to content

Commit 1f24932

Browse files
author
Fergus Bisset
committed
chore(ci): make all releases manual-only
- Remove automatic trigger on git tags - All releases now require manual workflow dispatch - Add 'tag' input to specify NPM dist-tag (latest, alpha, beta, etc.) - Update preid description with examples - Only create git tags when version is bumped in the workflow This prevents accidental releases from local version bumps and gives full control over when and how packages are published.
1 parent fcf61a7 commit 1f24932

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
name: Publish GitHub Package
22

33
on:
4-
push:
5-
tags:
6-
- 'v*'
74
workflow_dispatch:
85
inputs:
96
version:
107
description: 'Optional semver bump to apply before publishing (patch, minor, major, prerelease)'
118
required: false
129
type: string
1310
preid:
14-
description: 'Prerelease identifier when version is prerelease'
11+
description: 'Prerelease identifier when version is prerelease (e.g., alpha, beta, rc)'
1512
required: false
1613
type: string
14+
tag:
15+
description: 'NPM dist-tag to publish under (e.g., latest, alpha, beta, next)'
16+
required: false
17+
default: 'latest'
18+
type: string
1719

1820
permissions:
1921
contents: read
@@ -55,10 +57,15 @@ jobs:
5557
- name: Publish (GitHub Packages)
5658
env:
5759
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
run: npm publish --access public
60+
run: |
61+
if [ -n "${{ inputs.tag }}" ] && [ "${{ inputs.tag }}" != "latest" ]; then
62+
npm publish --access public --tag ${{ inputs.tag }}
63+
else
64+
npm publish --access public
65+
fi
5966
60-
- name: Create Git Tag (manual dispatch without tag)
61-
if: ${{ github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/') }}
67+
- name: Create Git Tag (when version bumped)
68+
if: ${{ inputs.version != '' }}
6269
run: |
6370
VERSION=$(node -p "require('./package.json').version")
6471
git config user.name github-actions

0 commit comments

Comments
 (0)