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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user