From 78c040b0994976c9ef03c2aa69365bd69d8df0aa Mon Sep 17 00:00:00 2001 From: Glenn Date: Wed, 25 Oct 2023 16:23:16 +0200 Subject: [PATCH] ci: try fixing file upload --- .drone.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6906ead..7e5a675 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,7 +22,7 @@ steps: - cp -r bin/mfm /_cache/bin/$PACKAGE_BASENAME - name: publish:tag - image: curlimages/curl + image: alpine environment: PACKAGE_UPLOAD_URL: https://code.apps.glenux.net/api/v1/packages/glenux/generic/mfm RELEASES_URL: https://code.apps.glenux.net/api/v1/repos/glenux/mfm/releases @@ -39,6 +39,7 @@ steps: - name: cache path: /_cache commands: + - apk add --update --no-cache curl jq - env |grep DRONE - | curl -H "Authorization: token $PACKAGE_UPLOAD_TOKEN" \ @@ -52,6 +53,15 @@ steps: -H 'Content-Type: application/json' \ -d "{\"body\": \"DRAFT\", \"draft\": true, \"name\": \"$DRONE_TAG - DRAFT\", \"prerelease\": false, \"tag_name\": \"$DRONE_TAG\", \"target_commitish\": \"$DRONE_COMMIT_SHA\"}" \ "$RELEASES_URL" + - | + curl -X 'GET' \ + -H 'accept: application/json' \ + "$RELEASES_URL/tags/$DRONE_TAG" + - | + TAG_ID="$(curl -X 'GET' \ + -H 'accept: application/json' \ + "$RELEASES_URL/tags/$DRONE_TAG" | jq -r .id)" + echo "TAG_ID=$TAG_ID" - | set -x curl -X POST \ @@ -59,7 +69,7 @@ steps: -H "accept: application/json" \ -H "Content-Type: multipart/form-data" \ -F "attachment=@/_cache/bin/$PACKAGE_BASENAME" \ - "$RELEASES_URL/$DRONE_TAG/assets?name=$PACKAGE_BASENAME" + "$RELEASES_URL/$TAG_ID/assets?name=$PACKAGE_BASENAME" # FIXME: handle multi-arch