Skip to content

Commit c4a6fa4

Browse files
authored
Update release.yml
1 parent dee29cb commit c4a6fa4

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,34 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v3
1717
name: Check out code
18+
with:
19+
ref: ${{ github.ref }} # 使用触发事件的分支
1820

1921
- name: Version convert
2022
id: convert_version
2123
run: |
22-
curl https://raw.githubusercontent.com/Websoft9/websoft9/main/docker/apphub/Dockerfile -o Dockerfile
24+
curl https://raw.githubusercontent.com/Websoft9/websoft9/${{ github.ref_name }}/docker/apphub/Dockerfile -o Dockerfile
2325
2426
library_tag=$(grep 'ARG LIBRARY_VERSION' "Dockerfile" | cut -d'"' -f2 | xargs)
2527
apphub_tag=$(grep 'LABEL version' "Dockerfile" | cut -d'"' -f2 | xargs)
2628
29+
# Determine the channel based on the branch and apphub_tag
30+
if [[ "${GITHUB_REF##*/}" == "dev" ]]; then
31+
echo "CHANNEL=dev" >> $GITHUB_ENV
32+
elif [[ "${GITHUB_REF##*/}" == "main" ]]; then
33+
if [[ "$apphub_tag" == *"-"* ]]; then
34+
echo "CHANNEL=rc" >> $GITHUB_ENV
35+
else
36+
echo "CHANNEL=release" >> $GITHUB_ENV
37+
fi
38+
fi
39+
40+
# Set library_tag_gh based on apphub_tag
2741
if [[ "$apphub_tag" == *"-"* ]]; then
2842
suffix="${apphub_tag#*-}"
2943
library_tag_gh="${library_tag}-${suffix}"
30-
echo "CHANNEL=dev" >> $GITHUB_ENV
3144
else
3245
library_tag_gh=$library_tag
33-
echo "CHANNEL=release" >> $GITHUB_ENV
3446
fi
3547
3648
echo "LIBRARY_TAG=$library_tag" >> $GITHUB_ENV
@@ -84,16 +96,11 @@ jobs:
8496
steps:
8597
- name: Checkout
8698
uses: actions/checkout@v4
99+
with:
100+
ref: ${{ github.ref }} # 使用触发事件的分支
87101

88102
- name: Setup Pages
89103
uses: actions/configure-pages@v4
90104

91105
- name: Upload artifact
92-
uses: actions/upload-pages-artifact@v2
93-
with:
94-
# Upload entire repository
95-
path: '.'
96-
97-
- name: Deploy to GitHub Pages
98-
id: deployment
99-
uses: actions/deploy-pages@v3
106+
uses: actions

0 commit comments

Comments
 (0)