update workflows

This commit is contained in:
sunxyw 2023-02-17 16:32:10 +08:00
parent 16f2db3f28
commit c283a84263
No known key found for this signature in database
GPG Key ID: F391C42B19AFFC98
2 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,68 @@
name: Build Release Artifacts
on:
release:
types:
- published
workflow_dispatch:
jobs:
build-release-artifacts:
name: Build Release Artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
- name: Setup PHP
uses: sunxyw/workflows/setup-environment@main
with:
php-version: 8.1
php-extensions: swoole, posix, json
operating-system: ubuntu-latest
use-cache: true
- name: Build Phar
run: ./zhamao build
- name: Get Latest Release Upload URL
id: get-latest-release
run: curl https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.upload_url' | sed 's/{?name,label}//g' > upload_url.txt
- name: Upload Phar
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/octet-stream" \
$(cat upload_url.txt)/zm.phar \
--data-binary "@build/zm.phar"
update-changelog:
name: Update Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
- name: Setup PHP
uses: sunxyw/workflows/setup-environment@main
with:
php-version: 8.1
php-extensions: swoole, posix, json
operating-system: ubuntu-latest
use-cache: true
- name: Update Changelog
run: ./zhamao generate:text update-log-md
- name: Commit Changelog
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: update changelog
branch: ${{ github.base_ref }}

View File

@ -47,6 +47,16 @@ jobs:
commit_message: update api docs
branch: ${{ github.base_ref }}
- name: Update Class Aliases Docs
run: ./zhamao generate:text class-alias-md
if: ${{ github.event.pull_request.merged == true && contains(github.event.pull_request.changed_files, 'src/Globals/global_class_alias.php') }}
- name: Commit Class Aliases Docs
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: update class aliases docs
branch: ${{ github.base_ref }}
- name: Increment build number
id: increment-build-number
run: |