Skip to content

chore: bump version to 0.0.2 in package.json #5

chore: bump version to 0.0.2 in package.json

chore: bump version to 0.0.2 in package.json #5

Workflow file for this run

name: Build and Release
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [created]
permissions:
contents: write
packages: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
# 如果这是一个发布版本(tag),则创建一个 release
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
dist/*
token: ${{ secrets.GITHUB_TOKEN }}
# 发布到 npm
- name: Publish to NPM
if: startsWith(github.ref, 'refs/tags/')
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}