1
0
mirror of https://github.com/hanxi/xiaomusic.git synced 2025-12-06 14:52:50 +08:00

ci: 打包修改

This commit is contained in:
涵曦
2024-12-19 16:38:25 +08:00
parent 1023caf80a
commit 2b28bf8551
2 changed files with 40 additions and 10 deletions

View File

@@ -191,8 +191,29 @@ jobs:
sudo apt install -y gh sudo apt install -y gh
# 创建或更新 Release # 创建或更新 Release
- name: Create or update Release - name: Create or update Release main
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') if: github.ref == 'refs/heads/mtag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 设置 GH_TOKEN 环境变量
run: |
RELEASE_NAME=test
RELEASE_BODY="This release is automatically updated from the main branch."
# 检查是否已有同名 Release
EXISTING_RELEASE=$(gh release view "${RELEASE_NAME}" --json id --jq .id || echo "")
if [[ -n "${EXISTING_RELEASE}" ]]; then
echo "release exist"
else
# 创建新的 Release
gh release create "${RELEASE_NAME}" \
--prerelease=false \
--title "${RELEASE_NAME}" \
--notes "${RELEASE_BODY}"
fi
- name: Create or update Release tag
if: startsWith(github.ref, 'refs/tags/v')
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 设置 GH_TOKEN 环境变量 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 设置 GH_TOKEN 环境变量
run: | run: |
@@ -212,9 +233,23 @@ jobs:
--notes "${RELEASE_BODY}" --notes "${RELEASE_BODY}"
fi fi
# 上传多个文件并覆盖 # 上传多个文件并覆盖
- name: Upload assets to Release - name: Upload assets to Release main
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') if: github.ref == 'refs/heads/main'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 设置 GH_TOKEN 环境变量
run: |
RELEASE_NAME=test
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
- name: Upload assets to Release tag
if: startsWith(github.ref, 'refs/tags/v')
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 设置 GH_TOKEN 环境变量 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 设置 GH_TOKEN 环境变量
run: | run: |
@@ -225,4 +260,3 @@ jobs:
echo "type upload ${FILE}" echo "type upload ${FILE}"
gh release upload "${RELEASE_NAME}" "${FILE}" --clobber gh release upload "${RELEASE_NAME}" "${FILE}" --clobber
done done

View File

@@ -660,11 +660,7 @@ $('#version').on('click', function() {
data.forEach((item) => { data.forEach((item) => {
const option = document.createElement("option"); const option = document.createElement("option");
option.value = item.version; option.value = item.version;
if (item.version=="main"){ option.textContent = item.version;
option.textContent = "测试版";
} else {
option.textContent = item.version;
}
versionSelect.appendChild(option); versionSelect.appendChild(option);
}); });
}); });