Update release.yml

This commit is contained in:
qiaofeng1227 2024-12-29 08:55:34 +08:00 committed by GitHub
parent 9124abee7f
commit 63c8d71f91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,6 +5,7 @@ on:
push: push:
branches: branches:
- main - main
- dev
paths: paths:
- "version.json" - "version.json"
@ -24,9 +25,13 @@ jobs:
version_core=${version%%-*} version_core=${version%%-*}
echo "VERSION=$version" >> $GITHUB_OUTPUT echo "VERSION=$version" >> $GITHUB_OUTPUT
echo "VERSION_CORE=$version_core" >> $GITHUB_OUTPUT echo "VERSION_CORE=$version_core" >> $GITHUB_OUTPUT
if [[ $version == *-* ]]; then
echo "rc release version" if [[ $GITHUB_REF == *"refs/heads/dev"* ]]; then
echo "dev branch detected"
echo "CHANNEL=dev" >> $GITHUB_OUTPUT echo "CHANNEL=dev" >> $GITHUB_OUTPUT
elif [[ $version == *-* ]]; then
echo "rc release version"
echo "CHANNEL=rc" >> $GITHUB_OUTPUT
else else
echo "release version" echo "release version"
echo "CHANNEL=release" >> $GITHUB_OUTPUT echo "CHANNEL=release" >> $GITHUB_OUTPUT
@ -71,6 +76,7 @@ jobs:
destination-dir: ./${{ steps.convert_version.outputs.CHANNEL }}/websoft9 destination-dir: ./${{ steps.convert_version.outputs.CHANNEL }}/websoft9
- name: Create Github Release - name: Create Github Release
if: github.ref == 'refs/heads/main' # 仅在 main 分支上触发
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
files: | files: |
@ -84,6 +90,7 @@ jobs:
pages: pages:
name: Build Github Pages name: Build Github Pages
if: github.ref == 'refs/heads/main' # 仅在 main 分支上触发
permissions: permissions:
contents: read contents: read
pages: write pages: write