-
-
Notifications
You must be signed in to change notification settings - Fork 705
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Innei <i@innei.in>
- Loading branch information
Showing
3 changed files
with
35 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# 使用环境变量 GH_TOKEN | ||
curl_response=$(curl -L -H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $GH_TOKEN" \ | ||
"https://github.com/gitapi/repos/innei/shiro/actions/artifacts?per_page=5&page=1") | ||
download_url=$(echo $curl_response | jq -r '.artifacts[] | select(.name == "artifact") | .archive_download_url') | ||
|
||
if [ -z "$download_url" ] || [ "$download_url" == "null" ]; then | ||
echo "没有找到 URL 或发生了错误。" | ||
exit 1 | ||
else | ||
echo "找到的 URL: $download_url" | ||
# 此处可以添加用于下载文件的命令,例如: | ||
# curl -L "$download_url" -o desired_filename.zip | ||
fi | ||
|
||
# 使用环境变量 GH_TOKEN | ||
curl -L -H "Authorization: Bearer $GH_TOKEN" "$download_url" -o build.zip | ||
|
||
[ ! -d "shiro" ] && mkdir shiro | ||
unzip build.zip | ||
unzip -o release.zip 'standalone/*' -d shiro |