v0.0.10 #19
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: Publish to NPM Registry | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
ref: ${{ github.event.release.tag_name}} | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18 # 你可以选择所需的 Node.js 版本 | |
- name: Use Pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: ${{ vars.PNPM_7_VERSION }} | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Build package | |
run: pnpm build # 如果你的项目需要构建过程,请确保你有一个 "build" script 在 package.json 中 | |
- name: Test package | |
run: pnpm test # 确保你的项目有一个 "test" script 在 package.json 中 | |
- name: set token | |
run: echo -e //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc | |
env: | |
NPM_TOKEN: ${{ secrets.SHINED_NPM_PUBLISH_TOKEN }} | |
- name: Publish package | |
run: pnpm release |