create release with curl in workflow
Some checks failed
Build iso when a new version is pushed / test (push) Failing after 6s

This commit is contained in:
2025-04-16 02:16:54 +02:00
parent ca2a2a8e8d
commit 7044d1eebb

View File

@ -17,8 +17,8 @@ jobs:
with: with:
go-version: '>=1.20.1' go-version: '>=1.20.1'
- name: build iso #- name: build iso
run: make iso # run: make iso
- name: get commit tag - name: get commit tag
id: vars id: vars
@ -32,11 +32,26 @@ jobs:
git push origin ${{steps.vars.outputs.TAG}} git push origin ${{steps.vars.outputs.TAG}}
- name: create release - name: create release
uses: https://gitea.com/actions/gitea-release-action@main run: |
with: AUTH_TOKEN=${{secrets.RELEASE_TOKEN}}
tag_name: ${{steps.vars.outputs.TAG}} TAG_NAME=${{steps.vars.outputs.TAG}}
server_url: https://git.tmoron.fr owner=tom
name: ${{steps.vars.outputs.TAG}} repo=nix-config
files: |- set -e
nixos.iso release_create_res=$(curl -X POST -H "Authorization: token $AUTH_TOKEN" -H "content-type: application/json" -d '{"tag_name":"$TAG_NAME","name":"$TAG_NAME"}' "https://git.tmoron.fr/api/v1/repos/$owner/$repo/releases" 2>/dev/null)
api_key: ${{secrets.RELEASE_TOKEN}}
release_id=$(echo $release_create_res | jq -r .id)
echo $release_id
if [ $release_id == "null" ]; then
echo error
exit 1
fi
file_send_res=$(curl \
"https://git.tmoron.fr/api/v1/repos/$owner/$repo/releases/$release_id/assets?name=flake.nix"\
-H "Authorization: token $AUTH_TOKEN"\
-H "accept: application/json"\
-H "Content-Type: multipart/form-data"\
-F "attachment=@flake.nix" 2>/dev/null)
echo $file_send_res