【维护】添加发布流程和版本检查脚本 #2
Workflow file for this run
This file contains hidden or 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: check version and push tag | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Check version | |
| id: version-check | |
| run: | | |
| VERSION=$(./scripts/is-newer-version.bash) | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| if [ "$VERSION" != "0" ]; then | |
| echo "New version detected: $VERSION" | |
| else | |
| echo "No new version to release" | |
| fi | |
| - name: Push tag | |
| if: steps.version-check.outputs.version != '0' | |
| uses: actions-ecosystem/action-push-tag@v1 | |
| with: | |
| tag: "v${{ steps.version-check.outputs.version }}" |