-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
136 lines (125 loc) · 3.82 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
image: golang:latest
stages:
- test
- build
- pkg
- release
.buildbase:
stage: build
needs:
- test
script:
- make clean
- make build -e GOOS=linux -e GOARCH=amd64 -e BUILD_TARGET=linux-amd64
- make build -e GOOS=linux -e GOARCH=arm -e BUILD_TARGET=linux-arm
- make build -e GOOS=linux -e GOARCH=arm64 -e BUILD_TARGET=linux-arm64
- make build -e GOOS=linux -e GOARCH=arm -e GOARM=7 -e BUILD_TARGET=rpi3
- make build -e GOOS=darwin -e GOARCH=amd64 -e BUILD_TARGET=macOS-amd64
- make build -e GOOS=darwin -e GOARCH=arm64 -e BUILD_TARGET=macOS-arm64
.builddpkgs:
image: ubuntu:latest
stage: pkg
script:
- DEBIAN_FRONTEND=noninteractive apt update
- DEBIAN_FRONTEND=noninteractive apt-get install --yes make dh-make apt-utils dpkg-dev dpkg-sig ubuntu-dev-tools binutils-arm-linux-gnueabihf gcc-arm-linux-gnueabi build-essential
- make dpkg -e GOOS=linux -e GOARCH=amd64 -e BUILD_TARGET=linux-amd64
- make dpkg -e GOOS=linux -e GOARCH=arm -e BUILD_TARGET=linux-arm
- make dpkg -e GOOS=linux -e GOARCH=arm -e GOARM=7 -e BUILD_TARGET=rpi3
test:
stage: test
script:
- make clean test
build:development:
extends: .buildbase
artifacts:
paths:
- build
expire_in: 1 week
except:
- main
- master
- tags
build:development:dpkg:
extends: .builddpkgs
dependencies:
- build:development
artifacts:
paths:
- build
expire_in: 1 week
except:
- main
- master
- tags
build:main:
extends: .buildbase
artifacts:
paths:
- build
expire_in: 1 year
only:
- main
except:
- tags
build:tags:
variables:
APP_VERSION: $CI_COMMIT_TAG
extends: .buildbase
artifacts:
paths:
- build
expire_in: 5 years
only:
- tags
build:dpkg:
extends: .builddpkgs
variables:
APP_VERSION: $CI_COMMIT_TAG
dependencies:
- build:tags
artifacts:
paths:
- build
expire_in: 5 years
only:
- tags
publish:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- apk -U add curl make git
- make upload_pkgs
dependencies:
- build:tags
- build:dpkg
artifacts:
paths:
- build
expire_in: never
release:
name: 'Release $CI_COMMIT_TAG'
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_TAG'
description: See CHANGELOG.md
assets:
links:
- name: 'hk-svcs-bridge-linux-amd64'
url: 'https://gitlab.com/koalalorenzo/hk-svcs-bridge/-/jobs/${CI_JOB_ID}/artifacts/raw/build/hk-svcs-bridge-${CI_COMMIT_TAG}-linux-amd64'
- name: 'hk-svcs-bridge-linux-arm'
url: 'https://gitlab.com/koalalorenzo/hk-svcs-bridge/-/jobs/${CI_JOB_ID}/artifacts/raw/build/hk-svcs-bridge-${CI_COMMIT_TAG}-linux-arm'
- name: 'hk-svcs-bridge-linux-arm64'
url: 'https://gitlab.com/koalalorenzo/hk-svcs-bridge/-/jobs/${CI_JOB_ID}/artifacts/raw/build/hk-svcs-bridge-${CI_COMMIT_TAG}-linux-arm64'
- name: 'hk-svcs-bridge-rpi3'
url: 'https://gitlab.com/koalalorenzo/hk-svcs-bridge/-/jobs/${CI_JOB_ID}/artifacts/raw/build/hk-svcs-bridge-${CI_COMMIT_TAG}-rpi3'
- name: 'hk-svcs-bridge-macOS-amd64'
url: 'https://gitlab.com/koalalorenzo/hk-svcs-bridge/-/jobs/${CI_JOB_ID}/artifacts/raw/build/hk-svcs-bridge-${CI_COMMIT_TAG}-macOS-amd64'
- name: 'hk-svcs-bridge-macOS-arm64'
url: 'https://gitlab.com/koalalorenzo/hk-svcs-bridge/-/jobs/${CI_JOB_ID}/artifacts/raw/build/hk-svcs-bridge-${CI_COMMIT_TAG}-macOS-arm64'
- name: 'Debian Packages...'
url: 'https://gitlab.com/koalalorenzo/hk-svcs-bridge/-/jobs/${CI_JOB_ID}/artifacts/browse/build/'
link_type: 'package'
- name: 'Other binaries and files...'
url: 'https://gitlab.com/koalalorenzo/hk-svcs-bridge/-/jobs/${CI_JOB_ID}/artifacts/browse/'
link_type: 'other'
only:
- tags