feat: 支持 Monorepo 发布 github package #34
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
# 如果是开发合并请求到主干,则会根据约定式提交创建一个 releasePR,是一个新版本合并请求。 | |
name: release please | |
on: | |
push: | |
branches: | |
- v*.x | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-nvm | |
- run: npm ci | |
- run: npm run build | |
- uses: peter-evans/create-pull-request@v4 | |
id: pr | |
with: | |
committer: github-actions[bot] <github-actions-bot@users.noreply.github.com> | |
author: github-actions[bot] <github-actions-bot@users.noreply.github.com> | |
commit-message: 'chore: build dist' | |
title: 机器人自动创建的拉取请求,将会自动合并,请勿手动处理! | |
body: 机器人自动创建的拉取请求,将会自动合并,请勿手动处理! | |
- run: gh pr merge ${{ steps.pr.outputs.pull-request-number }} --merge --auto --delete-branch | |
if: ${{ steps.pr.outputs.pull-request-number }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
major: ${{ steps.release.outputs.major }} | |
minor: ${{ steps.release.outputs.minor }} | |
steps: | |
- uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
release-type: node | |
create-version: | |
runs-on: ubuntu-latest | |
needs: release | |
if: needs.release.outputs.release_created | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: jacobsvante/tag-major-minor-action@v0 | |
with: | |
major: ${{ needs.release.outputs.major }} | |
minor: ${{ needs.release.outputs.minor }} |