mirror of
https://github.com/hanxi/xiaomusic.git
synced 2025-12-11 15:38:14 +08:00
ci: 调试
This commit is contained in:
51
.github/workflows/ci.yml
vendored
51
.github/workflows/ci.yml
vendored
@@ -184,30 +184,39 @@ jobs:
|
|||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y gh
|
sudo apt install -y gh
|
||||||
|
|
||||||
|
# 创建或更新 Release
|
||||||
- name: Create or update Release
|
- name: Create or update Release
|
||||||
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 设置 GH_TOKEN 环境变量
|
||||||
run: |
|
run: |
|
||||||
RELEASE_NAME=${{ github.ref_name }}
|
RELEASE_NAME=${{ github.ref_name }}
|
||||||
gh release view "$RELEASE_NAME" > /dev/null 2>&1
|
RELEASE_BODY="This release is automatically updated from the ${RELEASE_NAME} branch."
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
gh release create "$RELEASE_NAME" \
|
# 检查是否已有同名 Release
|
||||||
./app-amd64.tar.gz \
|
EXISTING_RELEASE=$(gh release view "${RELEASE_NAME}" --json id --jq .id || echo "")
|
||||||
./app-amd64-lite.tar.gz \
|
|
||||||
./app-arm64.tar.gz \
|
if [[ -n "${EXISTING_RELEASE}" ]]; then
|
||||||
./app-arm64-lite.tar.gz \
|
echo "release exist"
|
||||||
./app-arm-v7.tar.gz \
|
else
|
||||||
./app-arm-v7-lite.tar.gz \
|
# 创建新的 Release
|
||||||
--title "$RELEASE_NAME" \
|
gh release create "${RELEASE_NAME}" \
|
||||||
--notes "Automated release for $RELEASE_NAME"
|
--prerelease=false \
|
||||||
else
|
--title "${RELEASE_NAME}" \
|
||||||
gh release upload "$RELEASE_NAME" \
|
--notes "${RELEASE_BODY}"
|
||||||
./app-amd64.tar.gz \
|
fi
|
||||||
./app-amd64-lite.tar.gz \
|
|
||||||
./app-arm64.tar.gz \
|
# 上传多个文件并覆盖
|
||||||
./app-arm64-lite.tar.gz \
|
- name: Upload assets to Release
|
||||||
./app-arm-v7.tar.gz \
|
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
||||||
./app-arm-v7-lite.tar.gz \
|
env:
|
||||||
--clobber
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 设置 GH_TOKEN 环境变量
|
||||||
|
run: |
|
||||||
|
RELEASE_NAME=${{ github.ref_name }}
|
||||||
|
|
||||||
|
FILES=$(find . -type f -name "app-*.tar.gz")
|
||||||
|
for FILE in ${FILES}; do
|
||||||
|
echo "type upload ${FILE}"
|
||||||
|
gh release upload "${RELEASE_NAME}" "${FILE}" --clobber
|
||||||
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user