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 - ' v0.[0-9]+.[0-9]+-SNAPSHOT.[0-9]+'
7+ - ' v0.[0-9]+.[0-9]+'
78
89permissions : {}
910
2425 - name : Update npm
2526 run : npm install -g npm@latest
2627 - run : npm ci
28+ - name : Select dist-tag
29+ run : |
30+ GIT_TAG=${GITHUB_REF#refs/tags/*}
31+ if [[ "$GIT_TAG" == v0.+([0-9]).+([0-9])-SNAPSHOT.+([0-9]) ]]; then
32+ DIST_TAG=next
33+ elif [[ "$GIT_TAG" == v0.+([0-9]).+([0-9]) ]]; then
34+ DIST_TAG=latest
35+ else
36+ echo "Error: the tag name '$GIT_TAG' does not match any of the patterns"
37+ exit 1
38+ fi
39+ echo "DIST_TAG=$DIST_TAG" >> "$GITHUB_ENV"
2740 - name : Check that KaitaiStream.js will be included
2841 run : |
29- npm publish --tag next --dry-run --json | jq --exit-status '.files | map(.path) | any(. == "KaitaiStream.js")'
42+ npm publish --tag "$DIST_TAG" --dry-run --json | jq --exit-status '.files | map(.path) | any(. == "KaitaiStream.js")'
3043 - name : Publish to npm
31- run : npm publish --tag next
44+ run : npm publish --tag "$DIST_TAG"
You can’t perform that action at this time.
0 commit comments