We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c6f616 commit eecec54Copy full SHA for eecec54
.github/workflows/npm-publish.yaml
@@ -1,6 +1,7 @@
1
name: Publish Package
2
3
on:
4
+ workflow_dispatch:
5
release:
6
types: [published]
7
@@ -22,9 +23,18 @@ jobs:
22
23
- run: npm ci
24
- run: npm test
25
- - name: Update version
26
+ - name: Set package version
27
+ env:
28
+ GH_TOKEN: ${{ github.token }}
29
run: |
- VERSION=${GITHUB_REF#refs/tags/v}
30
+ if [[ "${{ github.event_name }}" == "release" ]]; then
31
+ VERSION=${GITHUB_REF#refs/tags/v}
32
+ else
33
+ # Fetch the latest release tag using the GitHub CLI
34
+ VERSION=$(gh release view --json tagName --jq .tagName | sed 's/^v//')
35
+ fi
36
+
37
+ echo "Setting package version to ${VERSION}"
38
npm version $VERSION --no-git-tag-version
39
40
- run: npm publish --provenance --access=public
0 commit comments