ci: try creating a release automatically
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/tag Build was killed

This commit is contained in:
Glenn Y. Rolland 2023-10-25 15:24:36 +02:00
parent 7f6c927d4e
commit e90b9a2a4c

View file

@ -25,6 +25,7 @@ steps:
image: curlimages/curl image: curlimages/curl
environment: environment:
PACKAGE_UPLOAD_URL: https://code.apps.glenux.net/api/packages/glenux/generic/mfm PACKAGE_UPLOAD_URL: https://code.apps.glenux.net/api/packages/glenux/generic/mfm
RELEASES_URL: https://code.apps.glenux.net/api/repos/glenux/releases
PACKAGE_BASENAME: mfm_linux_amd64 PACKAGE_BASENAME: mfm_linux_amd64
PACKAGE_UPLOAD_TOKEN: PACKAGE_UPLOAD_TOKEN:
from_secret: PACKAGE_UPLOAD_TOKEN from_secret: PACKAGE_UPLOAD_TOKEN
@ -39,8 +40,22 @@ steps:
- env |grep DRONE - env |grep DRONE
- | - |
curl -H "Authorization: token $PACKAGE_UPLOAD_TOKEN" \ curl -H "Authorization: token $PACKAGE_UPLOAD_TOKEN" \
--upload-file /_cache/bin/$PACKAGE_BASENAME \ --upload-file "/_cache/bin/$PACKAGE_BASENAME" \
$PACKAGE_UPLOAD_URL/$DRONE_TAG/$PACKAGE_BASENAME "$PACKAGE_UPLOAD_URL/$DRONE_TAG/$PACKAGE_BASENAME"
- |
curl -H "Authorization: token $PACKAGE_UPLOAD_TOKEN" \
-X POST \
-H "accept: application/json" \
-H "content-type: application/json" \
-d "{\"tag_name\": \"$DRONE_TAG\", \"target_commitish\": \"$DRONE_COMMIT_SHA\"}" \
$RELEASES_URL
- |
curl -H "Authorization: token $PACKAGE_UPLOAD_TOKEN" \
-H "accept: application/json" \
-H "Content-Type: multipart/form-data" \
--upload-file "attachment=@/_cache/bin/$PACKAGE_BASENAME" \
"$RELEASES_URL/$DRONE_TAG/assets?name=$PACKAGE_BASENAME"
# FIXME: handle multi-arch # FIXME: handle multi-arch
# FIXME: publish only on tags # FIXME: publish only on tags