npm publish #10
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: | |
- "v*" | |
# 允许你从 Actions 选项卡手动运行此工作流程 | |
workflow_dispatch: | |
jobs: | |
publish: | |
if: github.event.repository.owner.id == github.event.sender.id | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 22.x | |
- name: Set Publishing Config | |
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: npm publish | |
run: | | |
cd ./cli | |
# npm publish -r --tag latest --no-git-checks | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Create Release and Upload Release Asset | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
tag_name: ${{ github.ref }} | |
name: Release ${{ github.ref }} | |
body: TODO New Release. | |
draft: false | |
prerelease: false | |
files: | | |
${{ secrets.ReleaseZipName }}.zip | |
LICENSE |