Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Cashmaney authored Aug 26, 2024
1 parent 30e12e9 commit 0bcf594
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18.x
- uses: pnpm/action-setup@v3
node-version: 20.x
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
- name: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm install
- run: pnpm build
- run: pnpm run publish
- name: Read package version
id: package_version
run: echo "VERSION=$(jq -r .version < ./package.json)" >> $GITHUB_ENV

- name: Determine prerelease tag
id: prerelease_check
run: |
if [[ "${{ env.VERSION }}" =~ \-(alpha|beta)\.[0-9]+$ ]]; then
echo "PRERELEASE=--tag beta" >> $GITHUB_ENV
else
echo "PRERELEASE=" >> $GITHUB_ENV
fi
- run: pnpm run publish ${{ env.PRERELEASE }}

github-release:
needs: [npm-publish]
Expand Down

0 comments on commit 0bcf594

Please sign in to comment.