-
Notifications
You must be signed in to change notification settings - Fork 125
chore(ci): trigger release workflow by git tag push #721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
560b272
921997e
5ce15d6
58e709e
e39e7d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,18 +2,54 @@ name: Release | |||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: [master] | ||||||
| tags: | ||||||
| - 'v*' | ||||||
|
|
||||||
| permissions: | ||||||
| contents: write | ||||||
| deployments: write | ||||||
| issues: write | ||||||
| pull-requests: write | ||||||
| id-token: write | ||||||
|
|
||||||
| jobs: | ||||||
| release: | ||||||
| name: NPM | ||||||
| uses: node-modules/github-actions/.github/workflows/npm-release.yml@master | ||||||
| secrets: | ||||||
| GIT_TOKEN: ${{ secrets.GIT_TOKEN }} | ||||||
| name: Publish to NPM | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Checkout repository | ||||||
| uses: actions/checkout@v6 | ||||||
|
|
||||||
| - name: Setup Vite+ | ||||||
| uses: voidzero-dev/setup-vp@v1 | ||||||
| with: | ||||||
| node-version: '22' | ||||||
| cache: true | ||||||
| run-install: true | ||||||
|
|
||||||
| - name: Verify version matches tag | ||||||
| run: | | ||||||
| TAG_VERSION="${GITHUB_REF_NAME#v}" | ||||||
| PKG_VERSION=$(node -p "require('./package.json').version") | ||||||
| if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then | ||||||
| echo "::error::Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)" | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| - name: Determine npm dist-tag | ||||||
| id: dist-tag | ||||||
| run: | | ||||||
| TAG_VERSION="${GITHUB_REF_NAME#v}" | ||||||
| if echo "$TAG_VERSION" | grep -qE '-([a-zA-Z]+)'; then | ||||||
| # Extract pre-release identifier (e.g., "beta" from "5.0.0-beta.0") | ||||||
| PRE_TAG=$(echo "$TAG_VERSION" | sed -E 's/.*-([a-zA-Z]+).*/\1/') | ||||||
| echo "tag=$PRE_TAG" >> "$GITHUB_OUTPUT" | ||||||
| else | ||||||
| echo "tag=latest" >> "$GITHUB_OUTPUT" | ||||||
| fi | ||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+39
to
+46
|
||||||
|
|
||||||
| - name: Publish to npm | ||||||
fengmk2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| run: npm publish --access public --tag ${{ steps.dist-tag.outputs.tag }} | ||||||
|
||||||
| run: npm publish --access public --tag ${{ steps.dist-tag.outputs.tag }} | |
| run: npm publish --access public --tag ${{ steps.dist-tag.outputs.tag }} --provenance |
Uh oh!
There was an error while loading. Please reload this page.