-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
95 lines (83 loc) · 2.51 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# SPDX-FileCopyrightText: 2022 René de Hesselle <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-or-later
variables:
GIT_DEPTH: 1
GIT_SUBMODULE_STRATEGY: recursive
WRK_DIR: /Users/Shared/work
CCACHE_DIR: /Users/Shared/work/ccache
stages:
- build
- release
include:
- remote: https://raw.githubusercontent.com/dehesselle/sdkchecksum/master/.gitlab-ci/verify_sdk-template.yml
#------------------------------------------------------------------------- build
# Built the toolset, from sources to dmg.
.build:
stage: build
script:
- !reference [ .verify_sdk, script ]
- ./build_toolset.sh
# Artifact size needs to stay below 1 GiB for GitLab.
- jhb/usr/bin/jhb run rustup self uninstall -y || true
- jhb/usr/bin/archive remove_nonessentials
- jhb/usr/bin/archive create_dmg
artifacts:
paths:
- mibap*.dmg
build:
extends: .build
parallel:
matrix:
- RUNNER: [ "macosintel", "macosarm" ]
rules:
- if: $RUNNER == "macosintel"
variables:
SDKROOT: /opt/sdks/MacOSX10.13.4.sdk
- if: $RUNNER == "macosarm"
variables:
SDKROOT: /opt/sdks/MacOSX11.3.sdk
tags:
- ${RUNNER}
after_script:
# Cleanup is necessary for persistent runners but can be disabled for
# debugging purposes. (the number is not random, it's the project ID)
- |
source jhb/etc/jhb.conf.sh
if [ ! -f "$WRK_DIR"/no_cleanup-47632031 ]; then
rm -rf "${VER_DIR:?}"
fi
#----------------------------------------------------------------------- release
# Release the toolset disk image.
.release:
stage: release
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+/
variables:
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mibap/${CI_COMMIT_TAG}"
release:upload:
extends: .release
image: curlimages/curl:latest
needs:
- build
script:
- |
for ARTIFACT in mibap*.dmg; do
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file ${ARTIFACT} ${PACKAGE_REGISTRY_URL}/${ARTIFACT}
done
release:publish:
extends: .release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- build
- release:upload
script:
- |
{
echo -n "release-cli create --name $CI_COMMIT_TAG --tag-name $CI_COMMIT_TAG "
for ARTIFACT in mibap*.dmg; do
echo -n "--assets-link '{\"name\":\"${ARTIFACT}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${ARTIFACT}\"}' "
done
} > create_release.sh
chmod 755 create_release.sh
./create_release.sh