Skip to content

Commit a8ee29a

Browse files
authored
ci: npm publishing workflow (#27)
1 parent f3d43b5 commit a8ee29a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/publish-npm.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ jobs:
2727
- name: Determine NPM Tag
2828
id: determine-npm-tag
2929
run: |
30-
VERSION_TAG="${{ github.event.inputs.version }}"
30+
VERSION_TAG=${GITHUB_REF#refs/tags/v}
3131
if [[ $VERSION_TAG == *"-"* ]]; then
32-
echo "NPM_TAG=${VERSION_TAG#*-}" >> $GITHUB_ENV
32+
echo ::set-output name=NPM_TAG::${VERSION_TAG#*-}
3333
else
34-
echo "NPM_TAG=latest" >> $GITHUB_ENV
34+
echo ::set-output name=NPM_TAG::latest
3535
fi
3636
3737
- name: Publish to NPM
3838
run: |
39-
yarn publish --new-version ${{ github.event.inputs.version }} --tag ${{ env.NPM_TAG }} --no-git-tag-version
39+
yarn publish --access public --new-version ${GITHUB_REF#refs/tags/v} --tag ${{ steps.determine-npm-tag.outputs.NPM_TAG }} --no-git-tag-version
4040
env:
4141
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)