Skip to content

Commit

Permalink
feat: 自动发包
Browse files Browse the repository at this point in the history
  • Loading branch information
Minyym committed Aug 20, 2024
1 parent 74fd64c commit 45fb1b1
Show file tree
Hide file tree
Showing 2 changed files with 238 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

permissions:
contents: write

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: 'https://registry.npmjs.org'

- name: ChangeLog
run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Build
run: npm run build

- name: Release
run: |
if [[ ${{ github.ref }} == *refs/tags/*-beta* ]]; then
npm publish --tag beta
elif [[ ${{ github.ref }} == *refs/tags/*-alpha* ]]; then
npm publish --tag alpha
else
npm publish
fi
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Loading

0 comments on commit 45fb1b1

Please sign in to comment.