Commit f9d4141e authored by Kristian Klausen's avatar Kristian Klausen 🎉
Browse files

Upload release artifacts to "Generic Packages Repository"

Fix #118
parent 72b29141
Pipeline #11029 failed with stages
in 24 seconds
......@@ -7,6 +7,12 @@ stages:
- test
- publish
workflow:
rules:
- if: $CI_COMMIT_TAG
when: never
- when: always
shellcheck:
stage: lint
before_script:
......@@ -69,7 +75,6 @@ build:secure:
only:
- master@archlinux/arch-boxes
- schedules@archlinux/arch-boxes
- tags@archlinux/arch-boxes
test-vagrant-boxes-format:
stage: test
......@@ -136,18 +141,25 @@ tag_release:
variables:
- $SCHEDULED_PUBLISH == "TRUE"
before_script:
- pacman -Syu --needed --noconfirm release-cli
- pacman -Syu --needed --noconfirm release-cli jq
variables:
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/images/v${BUILD_VERSION}"
script:
- release-cli create --name "v$BUILD_VERSION" --tag-name v$BUILD_VERSION \
--assets-link "{\"name\":\"Vagrant Cloud Release\",\"url\":\"https://app.vagrantup.com/archlinux/boxes/archlinux/versions/$BUILD_VERSION\"}" \
--assets-link "{\"name\":\"Browse artifacts\",\"url\":\"https://gitlab.archlinux.org/archlinux/arch-boxes/-/jobs/artifacts/v$BUILD_VERSION/browse/output?job=build:secure\"}"
- |
args=()
for f in output/*; do
base="$(basename "${f}")"
curl -sSf --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "${f}" "${PACKAGE_REGISTRY_URL}/${base}"
args+=(--assets-link "{\"name\":\"${base}\",\"filepath\":\"/${base/-$BUILD_VERSION}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${base}\"}")
done
- release-cli create --name "v$BUILD_VERSION" --tag-name v$BUILD_VERSION "${args[@]}"
publish:
stage: publish
tags:
- secure
only:
- tags@archlinux/arch-boxes
- schedules@archlinux/arch-boxes
before_script:
- pacman -Syu --needed --noconfirm vagrant
script:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment