ci: Refactor hardcoded content
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Glenn Y. Rolland 2023-03-21 22:29:05 +01:00
parent bdf7b60d5c
commit eb41a2e594
1 changed files with 8 additions and 6 deletions

View File

@ -4,7 +4,7 @@ type: docker
name: default
steps:
- name: Build
- name: build:binary
image: crystallang/crystal:1.7.1
volumes:
- name: cache
@ -18,11 +18,13 @@ steps:
- mkdir -p /_cache/bin
- cp -r bin/docmachine /_cache/bin
- name: Publish
- name: publish:tag
image: curlimages/curl
environment:
PACKAGE_TOKEN:
from_secret: PACKAGE_TOKEN
PACKAGE_UPLOAD_URL: https://code.apps.glenux.net/api/packages/glenux/generic/docmachine-utils
PACKAGE_BASENAME: docmachine
PACKAGE_UPLOAD_TOKEN:
from_secret: PACKAGE_UPLOAD_TOKEN
when:
ref:
include:
@ -33,9 +35,9 @@ steps:
commands:
- env |grep DRONE
- |
curl -H "Authorization: token $PACKAGE_TOKEN" \
curl -H "Authorization: token $PACKAGE_UPLOAD_TOKEN" \
--upload-file /_cache/bin/docmachine \
https://code.apps.glenux.net/api/packages/glenux/generic/docmachine-utils/$DRONE_TAG/docmachine
$PACKAGE_UPLOAD_URL/$DRONE_TAG/$PACKAGE_BASENAME
# FIXME: handle multi-arch
# FIXME: publish only on tags