-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
50 lines (43 loc) · 1.71 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
include:
- local: '.ci/dkml-compilers/gl/setup-dkml.gitlab-ci.yml'
linux:build:
extends: .linux:setup-dkml
script:
- ci/build-test.sh
# Exclude macOS until you have a https://gitlab.com/gitlab-com/runner-saas-macos-access-requests/-/issues approved!
# macos:build:
# extends: .macos:setup-dkml
# script:
# - ci/build-test.sh
win32:build:
extends: .win32:setup-dkml
script:
- msys64\usr\bin\bash -lc "ci/build-test.sh"
release:
stage: deploy
image: alpine
script:
- apk add jq rsync curl
# Make _release
- ci/prepare-release.sh
# Create public packages
- |
if [ -n "${CI_COMMIT_TAG:-}" ]; then
PKGTAG=$(printf "%s" "${CI_COMMIT_TAG}" | sed 's/^v//')
elif [ -n "${CI_COMMIT_BRANCH:-}" ]; then
PKGTAG=$(printf "%s" "${CI_COMMIT_BRANCH}" | sed 's/^v//')
else
PKGTAG="${CI_COMMIT_SHORT_SHA}"
fi
- CI_PROJECT_PATH_URLENCODED=$(printf %s "${CI_PROJECT_PATH}" | jq -s -R -r @uri) # Must be url-encoded per https://docs.gitlab.com/ee/user/packages/generic_packages/
- |
GLAB_CURL_HEADER="JOB-TOKEN: ${CI_JOB_TOKEN}"
find _release -mindepth 1 -maxdepth 1 -type d | while read -r dkml_target_abi; do
dkml_target_abi=$(basename "${dkml_target_abi}")
PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_PATH_URLENCODED}/packages/generic/${dkml_target_abi}/${PKGTAG}"
echo "${PACKAGE_REGISTRY_URL}"
find "_release/${dkml_target_abi}" -mindepth 1 -maxdepth 1 -type f | while read -r file; do
file=$(basename "${file}")
curl --fail --header "${GLAB_CURL_HEADER}" --upload-file "_release/${dkml_target_abi}/${file}" "${PACKAGE_REGISTRY_URL}/${file}"
done
done