@@ -96,24 +96,31 @@ jobs:
9696 path : dist/*.apk
9797 if-no-files-found : error
9898
99- - name : Create GitHub Release
99+ - name : Create or update GitHub Release
100100 if : startsWith(github.ref, 'refs/tags/')
101- uses : softprops/action-gh-release@v2
102- with :
103- tag_name : ${{ steps.ver.outputs.version }}
104- name : Selene-TV ${{ steps.ver.outputs.version }}
105- body : |
106- ## Selene-TV ${{ steps.ver.outputs.version }}
107-
108- | 安装包 | 架构 | 适用设备 |
109- |--------|------|----------|
110- | `SeleneTV-${{ steps.ver.outputs.version }}-arm64-v8a.apk` | armv8 (arm64-v8a) | 64 位 ARM,主流 Android TV / 电视盒子 |
111- | `SeleneTV-${{ steps.ver.outputs.version }}-armeabi-v7a.apk` | armv7a (armeabi-v7a) | 32 位 ARM,较老设备 |
112-
113- 不确定架构时优先选 **arm64-v8a**。
114- files : dist/*.apk
115- draft : false
116- prerelease : false
117- fail_on_unmatched_files : true
118101 env :
119- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
102+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
103+ VERSION : ${{ steps.ver.outputs.version }}
104+ run : |
105+ # 该 tag 已存在 release → 仅更新附件(--clobber 覆盖同名包),保留原有标题与说明,不新建、不改 log;
106+ # 不存在 → 新建 release 并写入架构说明表。
107+ if gh release view "${VERSION}" >/dev/null 2>&1; then
108+ echo "Release ${VERSION} exists — updating assets only (title/notes untouched)"
109+ gh release upload "${VERSION}" dist/*.apk --clobber
110+ else
111+ echo "Release ${VERSION} not found — creating"
112+ cat > notes.md <<'NOTES'
113+ ## Selene-TV __VERSION__
114+
115+ | 安装包 | 架构 | 适用设备 |
116+ |--------|------|----------|
117+ | `SeleneTV-__VERSION__-arm64-v8a.apk` | armv8 (arm64-v8a) | 64 位 ARM,主流 Android TV / 电视盒子 |
118+ | `SeleneTV-__VERSION__-armeabi-v7a.apk` | armv7a (armeabi-v7a) | 32 位 ARM,较老设备 |
119+
120+ 不确定架构时优先选 **arm64-v8a**。
121+ NOTES
122+ sed -i "s/__VERSION__/${VERSION}/g" notes.md
123+ gh release create "${VERSION}" dist/*.apk \
124+ --title "Selene-TV ${VERSION}" \
125+ --notes-file notes.md
126+ fi
0 commit comments