test with in workflow
Some checks failed
Release Workflow / set-release-target (push) Successful in 1s
/ verify (push) Has been skipped
/ caller (push) Failing after 1s
Release Workflow / build (db, amd64, linux) (push) Successful in 1m47s
Release Workflow / build (metadata, amd64, linux) (push) Successful in 1m49s
Release Workflow / prerelease (push) Failing after 0s

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2025-12-16 21:47:33 +01:00
commit 6cc12ecaed
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
2 changed files with 59 additions and 46 deletions

View file

@ -66,49 +66,7 @@ jobs:
prerelease:
runs-on: docker
needs: [set-release-target, build]
env:
TOKEN: ${{ secrets.RELEASE }}
TAG: ${{ needs.set-release-target.outputs.release_cible }}
steps:
- name: Download all build artifacts
uses: actions/download-artifact@v3
with:
path: dist/
- name: Publier tous les binaires
run: ls -lR dist/
- name: Install jq
run: |
apt-get update
apt-get install -y jq
- name: Create prerelease
run: |
curl -X POST \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
"https://git.g3e.fr/api/v1/repos/${{ github.repository }}/releases" \
-d @- <<EOF
{
"tag_name": "$TAG",
"name": "$TAG",
"body": "Prerelease automatique générée par la CI",
"draft": false,
"prerelease": true
}
EOF
- name: Upload asset
run: |
RELEASE_ID=$(curl -s \
-H "Authorization: token $TOKEN" \
https://git.g3e.fr/api/v1/repos/${{ github.repository }}/releases/tags/$TAG \
| jq -r .id)
echo ${RELEASE_ID}
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://git.g3e.fr/api/v1/repos/${{ github.repository }}/releases/$RELEASE_ID/assets?name=${FILE}"
done
uses: ./.forgejo/workflows/release.yml
with:
tag: ${{ needs.set-release-target.outputs.release_cible }}
secrets: inherit

View file

@ -0,0 +1,55 @@
on:
workflow_call:
inputs:
tag:
required: true
type: string
job:
release:
env:
TOKEN: ${{ secrets.RELEASE }}
TAG: ${{ inputs.tag }}
steps:
- name: Download all build artifacts
uses: actions/download-artifact@v3
with:
path: dist/
- name: Publier tous les binaires
run: ls -lR dist/
- name: Install jq
run: |
apt-get update
apt-get install -y jq
- name: Create prerelease
run: |
curl -X POST \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
"https://git.g3e.fr/api/v1/repos/${{ github.repository }}/releases" \
-d @- <<EOF
{
"tag_name": "$TAG",
"name": "$TAG",
"body": "Prerelease automatique générée par la CI",
"draft": false,
"prerelease": true
}
EOF
- name: Upload asset
run: |
RELEASE_ID=$(curl -s \
-H "Authorization: token ${TOKEN}" \
https://git.g3e.fr/api/v1/repos/${{ github.repository }}/releases/tags/${TAG} \
| jq -r .id)
echo ${RELEASE_ID}
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://git.g3e.fr/api/v1/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets?name=${FILE}"
done