chore: actions release

This commit is contained in:
lisonge
2023-09-04 18:11:22 +08:00
parent 238e58eda7
commit c121e1b8e1
3 changed files with 94 additions and 0 deletions

48
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
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 }}
- name: Log
if: ${{ steps.commit.outcome != 'success' }}
run: echo Nothing to commit.

27
.github/workflows/check.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Check
on:
push:
branches:
- '**'
pull_request:
branches:
- main
jobs:
check:
runs-on: ubuntu-latest
if: |
${{ !contains(github.event.head_commit.message, 'chore: release') }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: volta-cli/action@v3
- uses: pnpm/action-setup@v2
- run: pnpm install
- run: pnpm run check

19
.github/workflows/release-please.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: release-please-action