forked from Schanbro/WeekFocus
chore: refactor: switch from release github action
This commit is contained in:
1 parent
a8375c4025
commit
ce4a40c4f3
2 files changed
+36
-8
No files matched your search
@@ -134,12 +134,36 @@ jobs:
|
|||||||
echo "Release-Notes:"
|
echo "Release-Notes:"
|
||||||
cat "$NOTES_FILE"
|
cat "$NOTES_FILE"
|
||||||
|
|
||||||
- name: Release in Gitea erstellen
|
- name: Release in Gitea erstellen und APK hochladen
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
tag_name: ${{ github.ref_name }}
|
|
||||||
name: ${{ github.ref_name }}
|
|
||||||
body_path: ${{ runner.temp }}/release_notes.md
|
|
||||||
files: app/build/outputs/apk/release/WeekFocus-*.apk
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
TAG="$GITHUB_REF_NAME"
|
||||||
|
NOTES_FILE="$RUNNER_TEMP/release_notes.md"
|
||||||
|
AUTH="Authorization: token $TOKEN"
|
||||||
|
|
||||||
|
# Release holen oder neu anlegen
|
||||||
|
CODE=$(curl -sS -o release.json -w '%{http_code}' -H "$AUTH" "$API/releases/tags/$TAG")
|
||||||
|
if [ "$CODE" = "404" ]; then
|
||||||
|
jq -n --arg tag "$TAG" --arg name "$TAG" --rawfile body "$NOTES_FILE" \
|
||||||
|
'{tag_name:$tag, name:$name, body:$body}' > payload.json
|
||||||
|
curl -fsS -X POST -H "$AUTH" -H "Content-Type: application/json" \
|
||||||
|
-d @payload.json "$API/releases" -o release.json
|
||||||
|
elif [ "$CODE" != "200" ]; then
|
||||||
|
echo "Release konnte nicht abgefragt werden (HTTP $CODE)"
|
||||||
|
cat release.json
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
RELEASE_ID=$(jq -r .id release.json)
|
||||||
|
|
||||||
|
# APK hochladen, gleichnamige alte Assets vorher löschen
|
||||||
|
for APK in app/build/outputs/apk/release/WeekFocus-*.apk; do
|
||||||
|
NAME=$(basename "$APK")
|
||||||
|
for ID in $(jq -r --arg n "$NAME" '.assets[]? | select(.name==$n) | .id' release.json); do
|
||||||
|
curl -fsS -X DELETE -H "$AUTH" "$API/releases/$RELEASE_ID/assets/$ID"
|
||||||
|
done
|
||||||
|
curl -fsS -X POST -H "$AUTH" -F "attachment=@$APK" \
|
||||||
|
"$API/releases/$RELEASE_ID/assets?name=$NAME"
|
||||||
|
done
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.1.2] - 2026-10-03
|
||||||
|
### Changed
|
||||||
|
- chore: refactor: switch from release github action to bash
|
||||||
|
|
||||||
## [1.1.1] - 2026-10-03
|
## [1.1.1] - 2026-10-03
|
||||||
### Changed
|
### Changed
|
||||||
- refactor: move hardcoded text to strings.xml
|
- refactor: move hardcoded text to strings.xml
|
||||||
|
|||||||
Reference in new issue
Block a user