Merge pull request 'fix(release): remplace softprops/action-gh-release par l'API Forgejo native' (#74) from fix/forgejo-release-native-api into main
Some checks failed
CI / lint (push) Successful in 4m13s
CI / build (push) Successful in 3m28s
CI / intent-service-test (push) Successful in 6m51s
Release / sanity-build (push) Successful in 11m18s
CI / e2e (push) Successful in 15m16s
Release / build-android-apk (push) Successful in 9m38s
CI / test (push) Failing after 21m38s
CI / build-android (push) Has been skipped
Release / forgejo-release (push) Failing after 25s
Release / notify-portainer (push) Has been skipped
Some checks failed
CI / lint (push) Successful in 4m13s
CI / build (push) Successful in 3m28s
CI / intent-service-test (push) Successful in 6m51s
Release / sanity-build (push) Successful in 11m18s
CI / e2e (push) Successful in 15m16s
Release / build-android-apk (push) Successful in 9m38s
CI / test (push) Failing after 21m38s
CI / build-android (push) Has been skipped
Release / forgejo-release (push) Failing after 25s
Release / notify-portainer (push) Has been skipped
This commit is contained in:
commit
f6e501d7b5
1 changed files with 40 additions and 7 deletions
47
.github/workflows/release.yml
vendored
47
.github/workflows/release.yml
vendored
|
|
@ -130,13 +130,46 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: batchcooking.apk
|
name: batchcooking.apk
|
||||||
|
|
||||||
- uses: https://github.com/softprops/action-gh-release@v2
|
# softprops/action-gh-release (l'action GitHub habituelle pour ça)
|
||||||
with:
|
# échoue systématiquement contre ce Forgejo : sa requête de création
|
||||||
# Auto-généré depuis les PR mergées depuis le tag précédent — pas
|
# de release répond 405 (vérifié en conditions réelles, tag v0.2.0 —
|
||||||
# d'outillage de changelog à maintenir, cohérent avec l'absence
|
# pas un souci de ref bare comme les autres actions de ce fichier,
|
||||||
# d'outillage de versioning ailleurs dans le repo pour l'instant.
|
# une vraie incompatibilité d'API entre les deux plateformes qui n'a
|
||||||
generate_release_notes: true
|
# pas de contournement connu côté configuration de l'action). Appelle
|
||||||
files: batchcooking.apk
|
# directement l'API native de Forgejo plutôt qu'une action tierce
|
||||||
|
# dont la compatibilité GitHub-Forgejo n'est pas garantie.
|
||||||
|
#
|
||||||
|
# Pas d'équivalent à `generate_release_notes` ici (fonctionnalité
|
||||||
|
# propre à GitHub, pas répliquée par l'API Forgejo) — le corps de la
|
||||||
|
# release reste minimal, cohérent avec l'absence d'outillage de
|
||||||
|
# changelog ailleurs dans le repo.
|
||||||
|
- name: Crée la Release Forgejo
|
||||||
|
id: create-release
|
||||||
|
env:
|
||||||
|
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
api="$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases"
|
||||||
|
body="$(printf '{"tag_name":"%s","name":"%s","draft":false,"prerelease":false}' "$GITHUB_REF_NAME" "$GITHUB_REF_NAME")"
|
||||||
|
resp="$(curl -fsS -X POST "$api" \
|
||||||
|
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "$body")"
|
||||||
|
id="$(echo "$resp" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)"
|
||||||
|
if [ -z "$id" ]; then
|
||||||
|
echo "Réponse inattendue de l'API Release, pas d'id trouvé : $resp" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Release $GITHUB_REF_NAME créée (id=$id)"
|
||||||
|
echo "release-id=$id" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Attache l'APK à la Release
|
||||||
|
env:
|
||||||
|
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
api="$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/${{ steps.create-release.outputs.release-id }}/assets"
|
||||||
|
curl -fsS -X POST "$api?name=batchcooking.apk" \
|
||||||
|
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||||
|
-F "attachment=@batchcooking.apk"
|
||||||
|
|
||||||
notify-portainer:
|
notify-portainer:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue