Skip to content

Merge pull request #275 from FrontEndDev-org/release-please--branches… #140

Merge pull request #275 from FrontEndDev-org/release-please--branches…

Merge pull request #275 from FrontEndDev-org/release-please--branches… #140

# 如果 devPR 到主干,则会根据约定式提交创建一个 releasePR,是一个新版本合并请求
# 如果 releasePR 到主干,则会触发新版本发布到 npm/github 等仓库
name: release please
on:
push:
branches:
- v*.x
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
bump-minor-pre-major: true
publish-npm:
needs: release
if: needs.release.outputs.release_created
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-nvm
- run: npm ci
- run: npm run build
- uses: FrontEndDev-org/publish-node-package-action@v1
with:
target: npm
token: ${{ secrets.NPM_TOKEN }}
- uses: FrontEndDev-org/npm-mirror-sync-action@v1
publish-github:
needs: release
if: needs.release.outputs.release_created
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-nvm
- run: npm ci
- run: npm run build
- uses: FrontEndDev-org/publish-node-package-action@v1
with:
target: github