Skip to content

Commit fc3b89e

Browse files
committed
add dev trigger content
1 parent 4639b66 commit fc3b89e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,30 @@ jobs:
1313
CI: false
1414
appname: library
1515
steps:
16-
- uses: actions/checkout@v3
17-
name: Check out code
16+
- name: Check out code
17+
uses: actions/checkout@v3
1818
with:
19-
ref: ${{ github.event.client_payload.ref }} # 使用触发事件的分支
19+
ref: ${{ github.event.client_payload.branch }}
2020

2121
- name: Version convert
2222
id: convert_version
2323
run: |
24-
curl https://raw.githubusercontent.com/Websoft9/websoft9/${{ github.event.client_payload.ref_name }}/docker/apphub/Dockerfile -o Dockerfile
24+
BRANCH_NAME=${{ github.event.client_payload.branch }}
25+
curl https://raw.githubusercontent.com/Websoft9/websoft9/${BRANCH_NAME}/docker/apphub/Dockerfile -o Dockerfile
2526
2627
library_tag=$(grep 'ARG LIBRARY_VERSION' "Dockerfile" | cut -d'"' -f2 | xargs)
2728
apphub_tag=$(grep 'LABEL version' "Dockerfile" | cut -d'"' -f2 | xargs)
2829
2930
# Determine the channel based on the branch and apphub_tag
30-
if [[ "${{ github.event.client_payload.ref_name }}" == "dev" ]]; then
31+
if [[ "$BRANCH_NAME" == "dev" ]]; then
3132
echo "CHANNEL=dev" >> $GITHUB_ENV
32-
elif [[ "${{ github.event.client_payload.ref_name }}" == "main" ]]; then
33+
elif [[ "$BRANCH_NAME" == "main" ]]; then
3334
if [[ "$apphub_tag" == *"-"* ]]; then
35+
suffix="${apphub_tag#*-}"
36+
library_tag_gh="${library_tag}-${suffix}"
3437
echo "CHANNEL=rc" >> $GITHUB_ENV
3538
else
39+
library_tag_gh=$library_tag
3640
echo "CHANNEL=release" >> $GITHUB_ENV
3741
fi
3842
fi
@@ -74,6 +78,7 @@ jobs:
7478
destination-dir: ./${{ env.CHANNEL }}/websoft9/plugin/${{ env.appname }}
7579

7680
- name: Create Github Release from code
81+
if: env.CHANNEL != 'dev'
7782
uses: softprops/action-gh-release@v1
7883
with:
7984
files: |
@@ -85,6 +90,7 @@ jobs:
8590

8691
pages:
8792
name: Build Github Pages
93+
if: env.CHANNEL != 'dev'
8894
permissions:
8995
contents: read
9096
pages: write

0 commit comments

Comments
 (0)