ci(release): upload versioned assets only, auto-update zipUrl
This commit is contained in:
+15
-15
@@ -140,30 +140,30 @@ jobs:
|
|||||||
gh release delete "$VER" --yes 2>/dev/null || true
|
gh release delete "$VER" --yes 2>/dev/null || true
|
||||||
RELEASE=$(ls zips/*Release*.zip | head -1)
|
RELEASE=$(ls zips/*Release*.zip | head -1)
|
||||||
DEBUG=$(ls zips/*Debug*.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" \
|
gh release create "$VER" \
|
||||||
--title "$VER" \
|
--title "$VER" \
|
||||||
--latest \
|
--latest \
|
||||||
--notes-file /tmp/notes.md \
|
--notes-file /tmp/notes.md \
|
||||||
"$RELEASE" \
|
"$RELEASE" \
|
||||||
"$DEBUG" \
|
"$DEBUG"
|
||||||
zips/TEESimulator-RS-Release.zip \
|
|
||||||
zips/TEESimulator-RS-Debug.zip
|
|
||||||
env:
|
env:
|
||||||
VER: ${{ steps.ver.outputs.version }}
|
VER: ${{ steps.ver.outputs.version }}
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Bump update.json versionCode
|
- name: Bump update.json
|
||||||
run: |
|
run: |
|
||||||
COUNT=$(git rev-list HEAD --count)
|
COUNT=$(git rev-list HEAD --count)
|
||||||
CURRENT=$(jq -r '.versionCode' module/update.json)
|
RELEASE_NAME=$(basename zips/*Release*.zip)
|
||||||
if [ "$COUNT" != "$CURRENT" ]; then
|
ZIP_URL="https://github.com/${{ github.repository }}/releases/download/${VER}/${RELEASE_NAME}"
|
||||||
jq ".versionCode = $COUNT" module/update.json > /tmp/update.json
|
jq ".versionCode = $COUNT | .zipUrl = \"$ZIP_URL\"" module/update.json > /tmp/update.json
|
||||||
mv /tmp/update.json module/update.json
|
mv /tmp/update.json module/update.json
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
git add module/update.json
|
git add module/update.json
|
||||||
git commit -m "chore(release): bump versionCode to $COUNT [skip ci]"
|
git diff --cached --quiet || {
|
||||||
|
git commit -m "chore(release): bump update.json to $VER [skip ci]"
|
||||||
git push origin HEAD:main
|
git push origin HEAD:main
|
||||||
fi
|
}
|
||||||
|
env:
|
||||||
|
VER: ${{ steps.ver.outputs.version }}
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user