Skip to content

Commit

Permalink
ci: update publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
microshine committed Jan 16, 2024
1 parent ab0046f commit e4c08e2
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,31 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Setup .npmrc
shell: bash
run: |
npm set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

- name: Ensure access
shell: bash
run: npm whoami --registry https://registry.npmjs.org/
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Publish to NPM
run: |
npm set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish --access public
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down

0 comments on commit e4c08e2

Please sign in to comment.