From 2b7c2b8450bf11d9194d9e7a16a52d07a66c5a84 Mon Sep 17 00:00:00 2001 From: eddy Date: Mon, 3 Aug 2026 14:23:20 +0200 Subject: [PATCH] fix(release): replace missing forgejo-release action with direct Forgejo API calls The forgejo-release@v1 action was never published to the Forgejo packages registry, causing the release workflow to fail with a 404 when cloning the action. Replace it with curl calls to the Forgejo API: POST /releases to create the release, then POST /assets for each artifact file. --- .forgejo/workflows/release.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 8e46c45..2266a43 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -46,9 +46,26 @@ jobs: sha256sum * > checksums.txt - name: Create Forgejo release - uses: https://git.eddydevink.nl/api/packages/eddy/actions/forgejo-release@v1 - with: - token: ${{ secrets.FORGEJO_TOKEN }} - tag: ${{ github.ref_name }} - title: ${{ github.ref_name }} - files: release/artifacts/* + env: + FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} + TAG: ${{ github.ref_name }} + run: | + API="https://git.eddydevink.nl/api/v1/repos/eddy/Project_SylDa/releases" + RELEASE=$(curl -s -X POST \ + -H "Authorization: token $FORGEJO_TOKEN" \ + -H "Content-Type: application/json" \ + -d "{\"tag_name\": \"$TAG\", \"name\": \"$TAG\"}" \ + "$API") + RELEASE_ID=$(echo "$RELEASE" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])") + echo "Created release $TAG (id=$RELEASE_ID)" + + for file in release/artifacts/*; do + name=$(basename "$file") + echo "Uploading $name..." + curl -s -X POST \ + -H "Authorization: token $FORGEJO_TOKEN" \ + -H "Content-Type: application/octet-stream" \ + --data-binary "@$file" \ + "$API/$RELEASE_ID/assets?name=$name" > /dev/null + done + echo "Release $TAG published with $(ls release/artifacts | wc -l) assets"