feat:完善submodule+github release共同组成的插件管理模式,并发布正式版v1.0.0 !packing vers… #3
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
name: Auto Release Workflow | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
create-release: | |
if: contains(github.event.head_commit.message, '!packing') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Get version from commit message | |
id: get_version | |
run: | | |
COMMIT_MSG="${{ github.event.head_commit.message }}" | |
if [[ $COMMIT_MSG =~ version=([^[:space:]]+) ]]; then | |
VERSION="${BASH_REMATCH[1]}" | |
else | |
echo "Error: No version found in commit message" | |
exit 1 | |
fi | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Create Release ZIP | |
run: | | |
zip -r release.zip . -x "*.git*" | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
with: | |
tag_name: v${{ steps.get_version.outputs.version }} | |
name: Release v${{ steps.get_version.outputs.version }} | |
draft: false | |
prerelease: false | |
files: release.zip | |
body: | | |
自动发布版本 v${{ steps.get_version.outputs.version }} | |
触发提交信息: ${{ github.event.head_commit.message }} |