-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
67 lines (63 loc) · 2.17 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
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/risserlabs/community/images/debian:0.0.1
# rules:
# - if: $CI_COMMIT_TAG
# script:
# - make pkg-deb
# artifacts:
# paths:
# - "*.deb"
# expire_in: 1 hour
upload:
stage: upload
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
# needs:
# - build
script:
# - export DEB=$(ls | grep -E '\.deb$')
- cat install.sh | sed "s|<% MKPM_VERSION %>|$MKPM_VERSION|g" > _install.sh
- cat mkpm.mk | sed "s|<% MKPM_VERSION %>|$MKPM_VERSION|g" > _mkpm.mk
- cat mkpm.sh | sed "s|<% MKPM_VERSION %>|$MKPM_VERSION|g" > _mkpm.sh
- cat mkpm-proxy.sh | sed "s|<% MKPM_VERSION %>|$MKPM_VERSION|g" > _mkpm-proxy.sh
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file _mkpm.sh \
${PACKAGE_REGISTRY_URL}/mkpm.sh
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file _mkpm.mk \
${PACKAGE_REGISTRY_URL}/mkpm.mk
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file _install.sh \
${PACKAGE_REGISTRY_URL}/install.sh
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file _mkpm-proxy.sh \
${PACKAGE_REGISTRY_URL}/mkpm-proxy.sh
# artifacts:
# paths:
# - "*.deb"
# 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 | grep -E '\.deb$')
- |
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\"}"