Skip to content

chore: release main (#241) #74

chore: release main (#241)

chore: release main (#241) #74

Workflow file for this run

name: release
on:
push:
branches:
- main
# 赋予 release-please-action 权限
permissions:
contents: write
pull-requests: write
jobs:
# 设置 release-please 任务
release-please:
# 设置任务运行环境为 ubuntu-latest
runs-on: ubuntu-latest
steps:
# 使用 release-please-action 动作来自动创建发布 PR
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: .release-please-config.json
manifest-file: .release-please-manifest.json
- name: 检出代码
uses: actions/checkout@v4
if: ${{ steps.release.outputs['packages/core--release_created'] || steps.release.outputs['packages/cli--release_created'] || steps.release.outputs['packages/create-karin--release_created'] }}
- name: 设置 node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs['packages/core--release_created'] || steps.release.outputs['packages/cli--release_created'] || steps.release.outputs['packages/create-karin--release_created'] }}
- name: 设置 pnpm
uses: pnpm/action-setup@v2
with:
version: 8
if: ${{ steps.release.outputs['packages/core--release_created'] || steps.release.outputs['packages/create-karin--release_created'] }}
# 安装所有依赖
- name: 安装依赖
run: pnpm install
if: ${{ steps.release.outputs['packages/core--release_created'] || steps.release.outputs['packages/create-karin--release_created'] }}
# 发布 core 包
- name: 发布 core 包
if: ${{ steps.release.outputs['packages/core--release_created'] }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
working-directory: packages/core
run: pnpm build:prod && pnpm pub
# 发布 cli 包
- name: 发布 cli 包
if: ${{ steps.release.outputs['packages/cli--release_created'] }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
working-directory: packages/cli
run: pnpm pub
# 发布 create-karin 包
- name: 发布 create-karin 包
if: ${{ steps.release.outputs['packages/create-karin--release_created'] }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
working-directory: packages/create-karin
run: pnpm build && pnpm pub