summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Daudt <kdaudt@alpinelinux.org>2021-09-30 12:53:25 +0200
committerTimo Teräs <timo.teras@iki.fi>2021-12-14 21:00:27 +0200
commiteab6645cb8c03282fbe6b8484c3fd390cfd91a9c (patch)
tree6c976d74a4d6e24edc8dc460a08ede4dce265351
parent18bcc4a5b7c7b635251717c2a6a4b2cf4e814564 (diff)
downloadapk-tools-eab6645cb8c03282fbe6b8484c3fd390cfd91a9c.tar.gz
apk-tools-eab6645cb8c03282fbe6b8484c3fd390cfd91a9c.tar.bz2
apk-tools-eab6645cb8c03282fbe6b8484c3fd390cfd91a9c.tar.xz
apk-tools-eab6645cb8c03282fbe6b8484c3fd390cfd91a9c.zip
ci: create release from tags
-rw-r--r--.gitlab-ci.yml47
1 files changed, 47 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e298e0e..925316f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,11 @@
stages:
- test
- build
+ - upload
+ - release
+
+variables:
+ PACKAGE_ENDPOINT: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/"
test:alpine:
image: alpine
@@ -50,3 +55,45 @@ build-static:
tags:
- docker-alpine
- $ARCH
+
+make-release:
+ stage: release
+ image: registry.gitlab.com/gitlab-org/release-cli:latest
+ script:
+ - |-
+ apk add curl
+ for artifact in src/apk.static-*; do
+ ! [ -f "$artifact" ] && { echo "No artifacts found"; exit 1; }
+ ARCH=${artifact#*-}
+ echo "Uploading binary for $ARCH"
+ curl --fail -H "JOB-TOKEN: $CI_JOB_TOKEN" -T "$artifact" -o /dev/null ${PACKAGE_ENDPOINT}/$CI_COMMIT_TAG/$ARCH/apk.static
+ done
+ - echo "Making a release"
+ release:
+ name: $CI_COMMIT_TAG
+ description: "Release $CI_COMMIT_TAG"
+ tag_name: $CI_COMMIT_TAG
+ ref: $CI_COMMIT_TAG
+ assets:
+ links:
+ - name: apk.static (x86_64)
+ url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/x86_64/apk.static
+ - name: apk.static (x86)
+ url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/x86/apk.static
+ - name: apk.static (armv7)
+ url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/armv7/apk.static
+ - name: apk.static (armhf)
+ url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/armhf/apk.static
+ - name: apk.static (aarch64)
+ url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/aarch64/apk.static
+ - name: apk.static (s390x)
+ url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/s390x/apk.static
+ - name: apk.static (ppc64le)
+ url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/ppc64le/apk.static
+ - name: apk.static (riscv64)
+ url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/riscv64/apk.static
+ rules:
+ - if: $CI_COMMIT_TAG
+ tags:
+ - docker-alpine
+ - x86_64