add file upload first
Some checks failed
Release Workflow / set-release-target (push) Successful in 1s
Release Workflow / build (db, amd64, linux) (push) Has been cancelled
Release Workflow / build (metadata, amd64, linux) (push) Has been cancelled
Release Workflow / prerelease (push) Has been cancelled

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2025-12-15 12:08:33 +01:00
commit b816ffae81
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632

View file

@ -65,9 +65,10 @@ jobs:
path: dist/${{ matrix.binaries }}_${{ matrix.goos }}_${{ matrix.goarch }} path: dist/${{ matrix.binaries }}_${{ matrix.goos }}_${{ matrix.goarch }}
prerelease: prerelease:
runs-on: docker runs-on: docker
needs: build needs: [set-release-target, build]
env: env:
TOKEN: ${{ secrets.RELEASE }} TOKEN: ${{ secrets.RELEASE }}
TAG: ${{ needs.set-release-target.outputs.release_cible }}
steps: steps:
- name: Download all build artifacts - name: Download all build artifacts
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
@ -81,7 +82,7 @@ jobs:
apt-get install -y jq apt-get install -y jq
- name: Create prerelease - name: Create prerelease
run: | run: |
curl -vvv -X POST \ curl -X POST \
-H "Authorization: token $TOKEN" \ -H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
"https://git.g3e.fr/api/v1/repos/${{ github.repository }}/releases" \ "https://git.g3e.fr/api/v1/repos/${{ github.repository }}/releases" \
@ -94,6 +95,16 @@ jobs:
"prerelease": true "prerelease": true
} }
EOF EOF
ls dist | while read tmp
do
FILE=$(ls "./dist/${tmp}")
echo ${FILE}
curl -X POST \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @dist/${tmp}/${FILE} \
"https://forgejo.example/api/v1/repos/{{ github.repository }}/releases/$RELEASE_ID/assets?name=${FILE}"
done
- name: Upload asset - name: Upload asset
run: | run: |
RELEASE_ID=$(curl -s \ RELEASE_ID=$(curl -s \