Replace softprops release action with native Gitea API release
Some checks failed
Build & Release Pack / build (push) Failing after 59s

softprops/action-gh-release@v1 is not mirrored on the Forgejo action
mirror, which fatally aborted the job at action-download. Create the
release via the Gitea REST API using the built-in GITHUB_TOKEN and
upload both pack artifacts directly.
This commit is contained in:
MiTHRAL 2026-08-19 15:33:43 -04:00
parent c3e6de91ff
commit 48b31d7d44

View file

@ -137,10 +137,19 @@ jobs:
- name: Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
files: |
SciCraft-Modrinth.mrpack
SciCraft-CurseForge.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
TAG="${GITHUB_REF_NAME}"
API="https://git.mithraic.cloud/api/v1/repos/ad3laid3/SciCraft/releases"
AUTH="Authorization: token ${{ secrets.GITHUB_TOKEN }}"
RELEASE_JSON=$(curl -sS -X POST "$API" \
-H "$AUTH" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"SCICRAFT $TAG\",\"body\":\"Automated release built from Gitea Actions.\"}")
RELEASE_ID=$(printf '%s' "$RELEASE_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
for f in SciCraft-Modrinth.mrpack SciCraft-CurseForge.zip; do
curl -sS -X POST "$API/$RELEASE_ID/assets?name=$(basename "$f")" \
-H "$AUTH" \
-F "attachment=@$f"
echo "Uploaded $f"
done