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
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:
parent
57d2f58cb6
commit
6cc12ecaed
2 changed files with 59 additions and 46 deletions
|
|
@ -66,49 +66,7 @@ jobs:
|
||||||
prerelease:
|
prerelease:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [set-release-target, build]
|
needs: [set-release-target, build]
|
||||||
env:
|
uses: ./.forgejo/workflows/release.yml
|
||||||
TOKEN: ${{ secrets.RELEASE }}
|
with:
|
||||||
TAG: ${{ needs.set-release-target.outputs.release_cible }}
|
tag: ${{ needs.set-release-target.outputs.release_cible }}
|
||||||
steps:
|
secrets: inherit
|
||||||
- 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
|
|
||||||
55
.forgejo/workflows/release.yml
Normal file
55
.forgejo/workflows/release.yml
Normal 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue