- Added NPM Login before the build stage #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: NPM Publish | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set version from tag | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: print version number | |
run: echo ${{ env.RELEASE_VERSION }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: configure git | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "Plattar" | |
- name: set pre-release version | |
run: npm version --prefix sdk-core ${{ env.RELEASE_VERSION }} | |
- name: write version.js | |
run: rm -rf sdk-core/src/version.ts && echo 'export default "${{ env.RELEASE_VERSION }}";' > sdk-core/src/version.ts | |
- name: copy README | |
run: cp README.md sdk-core/README.md | |
- name: copy graphics | |
run: cp -R graphics sdk-core/ | |
- name: NPM Login & Build | |
run: rm -rf sdk-core/.npmrc && npm set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_PUBLISH_KEY }} && npm run --prefix sdk-core clean:build | |
- uses: JS-DevTools/npm-publish@v1 | |
with: | |
package: ./sdk-core/package.json | |
token: ${{ secrets.NPM_PUBLISH_KEY }} | |
access: 'public' |