Skip to content

Commit

Permalink
Try to fix the NPM publishing script
Browse files Browse the repository at this point in the history
  • Loading branch information
CaspianA1 committed Jun 27, 2024
1 parent fb62d0e commit ba19e4a
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions .github/workflows/publish_npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,14 @@ jobs:
uses: actions/[email protected]
with:
node-version: 20
- name: Nerdbank.GitVersioning
id: nbgv
uses: dotnet/[email protected]
with:
stamp: ${{ matrix.package }}/package.json
- run: npm ci
- run: cd ${{ matrix.package }}; npm run build
- name: Publish release to npm
uses: JS-DevTools/npm-publish@v3
id: npmrelease
# boolean properties from NBGV step appears to be converted into *capitalized* strings
# so explicitly string compare PublicRelease output value
if: ${{ steps.nbgv.outputs.PublicRelease == 'True'}}
with:
token: ${{ secrets.NPM_PUBLISH }}
registry: https://registry.npmjs.org/
tag: ${{ steps.nbgv.outputs.PrereleaseVersion == '' && 'latest' || 'preview' }} # Assign a 'preview' tag to versions end with '-preview'. Otherwise, assign a 'latest' tag to the latest release.
access: public
package: ${{ matrix.package }}
- name: Publish test package to npm
- name: Publish package to npm
uses: JS-DevTools/npm-publish@v3
id: npmtest
if: ${{ steps.nbgv.outputs.PublicRelease == 'False'}}
with:
token: ${{ secrets.NPM_PUBLISH }}
registry: https://registry.npmjs.org/
tag: 'test'
tag: 'latest'
access: public
package: ${{ matrix.package }}
- if: ${{ steps.npmrelease.outputs.type }}
run: echo "Published a new release package!"
- if: ${{ steps.npmtest.outputs.type }}
run: echo "Published a new test package!"

0 comments on commit ba19e4a

Please sign in to comment.