-
Notifications
You must be signed in to change notification settings - Fork 100
/
.gitlab-ci.yml
116 lines (93 loc) · 3.31 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
image: ayufan/rock64-dockerfiles:bookworm
stages:
- build
variables:
GITHUB_USER: ayufan-rock64
GITHUB_REPO: linux-build
RELEASE_NAME: "${CI_COMMIT_TAG}"
RELEASE_TITLE: "${CI_COMMIT_TAG}: gitlab-ci-linux-build-${CI_PIPELINE_IID}"
PIPELINE_URL: $CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID
CACHE_ROOT: /data/shared/rock64-linux-cache
stages: [draft, build, package, images, pre-release]
before_script:
- 'export RELEASE=$((1000+$CI_PIPELINE_IID))'
- 'export CHANGES=$(grep -B1000 -A2 "${CI_COMMIT_TAG}" RELEASE.md || head -n 60 RELEASE.md)'
- 'export DESCRIPTION=$(echo -e "${CHANGES}\n\n${PIPELINE_URL}")'
- 'upload() { github-release upload --tag "${CI_COMMIT_TAG}" --name "$(basename "$1")" --file "$1"; }'
- 'upload_all() { for i in $*; do upload "$i"; done; }'
draft:
stage: draft
only: [tags]
script:
- github-release release --tag "${CI_COMMIT_TAG}" --name "$RELEASE_TITLE" --description "$DESCRIPTION" --target "$CI_COMMIT_SHA" --draft
package:
stage: package
only: [tags]
script:
- make linux-virtual BOARD_TARGET=rock64
- make linux-virtual BOARD_TARGET=rockpro64
- make linux-virtual BOARD_TARGET=rockpi4b
- make linux-virtual BOARD_TARGET=pinebookpro
- upload_all *.deb
- rm *.deb
artifacts:
paths:
- "*.deb"
pre-release:
stage: pre-release
only: [tags]
environment:
name: pre-release
url: https://github.com/$GITHUB_USER/$GITHUB_REPO/releases/tag/$CI_COMMIT_TAG
script:
- github-release edit --tag "${CI_COMMIT_TAG}" --name "$RELEASE_TITLE" --description "$DESCRIPTION" --pre-release
.build: &build
stage: images
only: [tags]
script:
- set -- $CI_JOB_NAME
- make "$1" BOARD_TARGET=$2
- upload_all *.xz
- upload_all *-packages.txt
- rm -f *.xz *-packages.txt
.build_optional: &build_optional
<<: *build
allow_failure: true
.build_manual: &build_manual
<<: *build
when: manual
allow_failure: true
focal-mate-armhf rock64: *build_optional
focal-mate-armhf rockpro64: *build_optional
focal-mate-armhf pinebookpro: *build_optional
focal-mate-arm64 rock64: *build_optional
focal-mate-arm64 rockpro64: *build_optional
focal-mate-arm64 pinebookpro: *build_optional
focal-lxde-armhf rock64: *build_manual
focal-lxde-armhf rockpro64: *build_manual
focal-lxde-armhf pinebookpro: *build_manual
focal-lxde-arm64 rock64: *build_manual
focal-lxde-arm64 rockpro64: *build_manual
focal-lxde-arm64 pinebookpro: *build_manual
focal-gnome-arm64 rock64: *build_optional
focal-gnome-arm64 rockpro64: *build_optional
focal-gnome-arm64 pinebookpro: *build_optional
focal-kde-arm64 rock64: *build_manual
focal-kde-arm64 rockpro64: *build_manual
focal-kde-arm64 pinebookpro: *build_manual
focal-xfce4-arm64 rock64: *build_optional
focal-xfce4-arm64 rockpro64: *build_optional
focal-xfce4-arm64 pinebookpro: *build_optional
buster-containers-arm64 rock64: *build
buster-containers-arm64 rockpro64: *build
buster-openmediavault-arm64 rock64: *build_optional
buster-openmediavault-arm64 rockpro64: *build_optional
buster-minimal-arm64 rock64: *build
buster-minimal-arm64 rockpro64: *build
focal-minimal-arm64 rock64: *build
focal-minimal-armhf rock64: *build
focal-minimal-arm64 rockpro64: *build
focal-minimal-armhf rockpro64: *build
focal-minimal-arm64 pinebookpro: *build
focal-minimal-armhf pinebookpro: *build
focal-minimal-arm64 rockpi4b: *build