mirror of
https://github.com/beilunyang/moemail.git
synced 2026-05-07 06:23:01 +08:00
ci: add CLI publish workflow triggered by cli-v* tags
This commit is contained in:
38
.github/workflows/publish-cli.yml
vendored
Normal file
38
.github/workflows/publish-cli.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Publish CLI
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'cli-v*'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build
|
||||
run: cd packages/cli && bun build ./src/index.ts --outdir ./dist --target=node
|
||||
|
||||
- name: Publish to npm
|
||||
run: cd packages/cli && npm publish --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
Reference in New Issue
Block a user