Skip to content

Commit

Permalink
ci: publish to npm fix (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev authored Oct 21, 2024
1 parent 362a59f commit 6367073
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ jobs:
solana-cli-version: '1.18.15'
node-version: '21.0.0'

- name: Setup Node.js for NPM Publish
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '21.0.0'
registry-url: 'https://registry.npmjs.org'
auth-token: ${{ secrets.NPM_TOKEN }}
node-version: "21"
registry-url: "https://registry.npmjs.org"

- name: Build
run: anchor build
Expand All @@ -38,18 +37,19 @@ jobs:
- name: Determine NPM Tag
id: determine-npm-tag
run: |
VERSION_TAG=${{ github.ref_name }}
VERSION_TAG=${GITHUB_REF#refs/tags/v}
if [[ $VERSION_TAG == *"-"* ]]; then
NPM_TAG=${VERSION_TAG#*-}
echo ::set-output name=NPM_TAG::${VERSION_TAG#*-}
else
NPM_TAG=latest
echo ::set-output name=NPM_TAG::latest
fi
echo "NPM_TAG=$NPM_TAG" >> "$GITHUB_OUTPUT"
env:
GITHUB_REF: ${{ github.ref }}

- name: Publish to NPM
run: |
yarn publish \
--access public \
--new-version "${{ github.ref_name }}" \
--tag "${{ steps.determine-npm-tag.outputs.NPM_TAG }}" \
--no-git-tag-version
yarn publish --access public --new-version ${GITHUB_REF#refs/tags/v} --tag ${{
steps.determine-npm-tag.outputs.NPM_TAG }} --no-git-tag-version
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_REF: ${{ github.ref }}

0 comments on commit 6367073

Please sign in to comment.