From ea792c7b7811b9b4313afdf93f7dd46b7993568f Mon Sep 17 00:00:00 2001 From: Enginex0 Date: Tue, 31 Mar 2026 19:12:46 +0100 Subject: [PATCH] ci(release): auto-bump versionCode and add stable asset names The release job now uploads assets with stable names (TEESimulator-RS-Release.zip) alongside versioned ones, so the /latest/download/ URL in update.json always resolves. versionCode in update.json is bumped to the commit count automatically after each release, committed with [skip ci] to prevent loops. --- .github/workflows/build.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a940692..8d62cec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -140,12 +140,30 @@ jobs: gh release delete "$VER" --yes 2>/dev/null || true RELEASE=$(ls zips/*Release*.zip | head -1) DEBUG=$(ls zips/*Debug*.zip | head -1) + cp "$RELEASE" zips/TEESimulator-RS-Release.zip + cp "$DEBUG" zips/TEESimulator-RS-Debug.zip gh release create "$VER" \ --title "$VER" \ --latest \ --notes-file /tmp/notes.md \ "$RELEASE" \ - "$DEBUG" + "$DEBUG" \ + zips/TEESimulator-RS-Release.zip \ + zips/TEESimulator-RS-Debug.zip env: VER: ${{ steps.ver.outputs.version }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Bump update.json versionCode + run: | + COUNT=$(git rev-list HEAD --count) + CURRENT=$(jq -r '.versionCode' module/update.json) + if [ "$COUNT" != "$CURRENT" ]; then + jq ".versionCode = $COUNT" module/update.json > /tmp/update.json + mv /tmp/update.json module/update.json + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add module/update.json + git commit -m "chore(release): bump versionCode to $COUNT [skip ci]" + git push origin HEAD:main + fi