This repository has been archived by the owner on Dec 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.gitlab-ci.yml
58 lines (53 loc) · 2.4 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
stages:
- build
- upload
- release
debian:
stage: build
image: ambitionecho/ubuntu-with-qt:latest
script:
- mkdir build && cd build
- sed -i "s/#define VERSION .*/#define VERSION \"$(git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')\"/g" ../src/about.h
- cmake ..
- make
- cd ../package
- ./package.sh
- mkdir ../upload
- cp ./*.deb ../upload/
- cd ..
artifacts:
paths:
- upload
upload:
stage: upload
image: curlimages/curl:latest
variables:
# Package version can only contain numbers (0-9), and dots (.).
# Must be in the format of X.Y.Z, i.e. should match /\A\d+\.\d+\.\d+\z/ regular expresion.
# See https://docs.gitlab.com/ee/user/packages/generic_packages/#publish-a-package-file
PACKAGE_VERSION: "${CI_COMMIT_TAG}"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/earth_wallpaper/${PACKAGE_VERSION}"
rules:
- if: $CI_COMMIT_TAG
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file upload/earth-wallpaper-deepin-amd64.deb "${PACKAGE_REGISTRY_URL}/earth-wallpaper-deepin-amd64-$CI_COMMIT_TAG.deb"
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file upload/earth-wallpaper-other-amd64.deb "${PACKAGE_REGISTRY_URL}/earth-wallpaper-other-amd64-$CI_COMMIT_TAG.deb"
release:
# Caution, as of 2021-02-02 these assets links require a login, see:
# https://gitlab.com/gitlab-org/gitlab/-/issues/299384
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
variables:
# Package version can only contain numbers (0-9), and dots (.).
# Must be in the format of X.Y.Z, i.e. should match /\A\d+\.\d+\.\d+\z/ regular expresion.
# See https://docs.gitlab.com/ee/user/packages/generic_packages/#publish-a-package-file
PACKAGE_VERSION: "${CI_COMMIT_TAG}"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/earth_wallpaper/${PACKAGE_VERSION}"
rules:
- if: $CI_COMMIT_TAG
script:
- |
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"earth-wallpaper-deepin-amd64-$CI_COMMIT_TAG.deb\",\"url\":\"${PACKAGE_REGISTRY_URL}/earth-wallpaper-deepin-amd64-$CI_COMMIT_TAG.deb\"}"\
--assets-link "{\"name\":\"earth-wallpaper-other-amd64-$CI_COMMIT_TAG.deb\",\"url\":\"${PACKAGE_REGISTRY_URL}/earth-wallpaper-other-amd64-$CI_COMMIT_TAG.deb\"}"