-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
73 lines (69 loc) · 2.28 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
stages:
- build
- upload
- publish
variables:
GIT_SUBMODULE_STRATEGY: recursive
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}"
MKPM_VERSION: "${CI_COMMIT_TAG}"
build:
stage: build
image: registry.gitlab.com/bitspur/rock8s/images/debian-build:bookworm
rules:
- if: $CI_COMMIT_TAG
before_script:
- git lfs install
script:
- make build-deb
- export DEB="$(cd .. && ls *.deb | head -n1 | sed 's|\([^_]*\)_\([^_]*\)_.*\.deb$|\1_\2_all.deb|g')"
- mv "../$(cd .. && ls *.deb | head -n1)" "$DEB"
artifacts:
paths:
- "*.deb"
- "build/*"
expire_in: 1 hour
upload:
stage: upload
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
needs:
- build
script:
- export DEB="$(ls *.deb | head -n1)"
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build/mkpm \
${PACKAGE_REGISTRY_URL}/mkpm.sh
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build/mkpm.mk \
${PACKAGE_REGISTRY_URL}/mkpm.mk
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build/install.sh \
${PACKAGE_REGISTRY_URL}/install.sh
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build/mkpm-proxy.sh \
${PACKAGE_REGISTRY_URL}/mkpm-proxy.sh
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file $DEB \
${PACKAGE_REGISTRY_URL}/${DEB}
artifacts:
paths:
- "*.deb"
- "build/*"
expire_in: 1 hour
release:
stage: publish
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
needs:
- upload
script:
- export DEB="$(ls *.deb | head -n1)"
- |
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"mkpm-proxy.sh\",\"url\":\"${PACKAGE_REGISTRY_URL}/mkpm-proxy.sh\"}" \
--assets-link "{\"name\":\"mkpm.sh\",\"url\":\"${PACKAGE_REGISTRY_URL}/mkpm.sh\"}" \
--assets-link "{\"name\":\"mkpm.mk\",\"url\":\"${PACKAGE_REGISTRY_URL}/mkpm.mk\"}" \
--assets-link "{\"name\":\"install.sh\",\"url\":\"${PACKAGE_REGISTRY_URL}/install.sh\"}" \
--assets-link "{\"name\":\"${DEB}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${DEB}\"}"