ci: Refactor hardcoded content
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Glenn Y. Rolland 2023-03-21 22:29:05 +01:00
parent bdf7b60d5c
commit eb41a2e594

View file

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