ci: try creating a release automatically
This commit is contained in:
parent
7f6c927d4e
commit
e90b9a2a4c
1 changed files with 17 additions and 2 deletions
19
.drone.yml
19
.drone.yml
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue