Commit 8f485d1 1 parent 923f9f3 commit 8f485d1 Copy full SHA for 8f485d1
File tree 2 files changed +27
-2
lines changed
2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 21
21
build_for_macosx :
22
22
needs : [create_release]
23
23
name : Build for MacOSX
24
- runs-on : macos-12
24
+ runs-on : macos-13
25
25
env :
26
26
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
27
27
steps :
Original file line number Diff line number Diff line change @@ -19,8 +19,33 @@ RELEASE_ID=$(curl -fsSL \
19
19
-H " X-GitHub-Api-Version: 2022-11-28" \
20
20
https://api.github.com/repos/aliyun/aliyun-cli/releases/tags/" $TAG " | jq ' .["id"]' )
21
21
22
+ if [ -z " $RELEASE_ID " ]; then
23
+ echo " Failed to get release ID for tag $TAG "
24
+ exit 1
25
+ fi
26
+
27
+ # 获取现有资产列表
28
+ ASSET_ID=$( curl -fsSL \
29
+ -H " Accept: application/vnd.github+json" \
30
+ -H " Authorization: Bearer $GITHUB_TOKEN " \
31
+ -H " X-GitHub-Api-Version: 2022-11-28" \
32
+ https://api.github.com/repos/aliyun/aliyun-cli/releases/$RELEASE_ID /assets | jq -r " .[] | select(.name == \" $( basename " $ASSET " ) \" ) | .id" )
33
+
34
+ # 如果资产已存在,删除它
35
+ if [ -n " $ASSET_ID " ]; then
36
+ echo " Asset already exists. Deleting asset ID $ASSET_ID "
37
+ curl -fsSL \
38
+ -X DELETE \
39
+ -H " Accept: application/vnd.github+json" \
40
+ -H " Authorization: Bearer $GITHUB_TOKEN " \
41
+ -H " X-GitHub-Api-Version: 2022-11-28" \
42
+ https://api.github.com/repos/aliyun/aliyun-cli/releases/assets/$ASSET_ID
43
+ fi
44
+
45
+ printf " Uploading %s to release %s\n" " $ASSET " " $RELEASE_ID "
46
+
22
47
curl -fsSL \
23
- -X POST \
48
+ -X PUT \
24
49
-H " Accept: application/vnd.github+json" \
25
50
-H " Authorization: Bearer $GITHUB_TOKEN " \
26
51
-H " X-GitHub-Api-Version: 2022-11-28" \
You can’t perform that action at this time.
0 commit comments