2023-09-04 18:11:22 +08:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
if: |
|
|
|
|
${{ contains(github.event.head_commit.message, 'chore: release') }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: volta-cli/action@v3
|
|
|
|
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
|
|
|
|
|
|
- run: pnpm install
|
|
|
|
|
|
|
|
- name: Release
|
|
|
|
run: |
|
|
|
|
pnpm run build
|
|
|
|
|
|
|
|
- name: Git commit
|
|
|
|
id: commit
|
|
|
|
run: |
|
|
|
|
git config --local user.email github-actions[bot]@users.noreply.github.com
|
|
|
|
git config --local user.name github-actions[bot]
|
|
|
|
git config --global core.autocrlf true
|
|
|
|
git config --global core.safecrlf false
|
|
|
|
git add .
|
|
|
|
git commit -m "CI build" -a
|
|
|
|
continue-on-error: true
|
|
|
|
|
|
|
|
- name: Git push
|
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
if: ${{ steps.commit.outcome == 'success' }}
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: ${{ github.ref }}
|
|
|
|
|
2023-09-04 19:25:02 +08:00
|
|
|
- name: Publish package
|
|
|
|
run: |
|
|
|
|
pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
|
|
|
|
publish
|
|
|
|
|
2023-09-04 18:11:22 +08:00
|
|
|
- name: Log
|
|
|
|
if: ${{ steps.commit.outcome != 'success' }}
|
|
|
|
run: echo Nothing to commit.
|