-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
110 lines (99 loc) · 2.92 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
# Copyright (C) 2020 Casper Meijn <[email protected]>
#
# SPDX-License-Identifier: CC0-1.0
stages:
- version
- build
- package
- release
version:
stage: version
image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1
script:
- release next-version --allow-current > .next-version
- echo Next version is $(<.next-version)
artifacts:
paths:
- .next-version
build:
stage: build
image: registry.gitlab.com/caspermeijn/docker-images/pinetime-build:latest
script:
- newt upgrade
- newt build boot-pinetime
- newt build klok-pinetime-release
- newt create-image klok-pinetime-release $(<.next-version)
artifacts:
paths:
- bin/targets/klok-pinetime-release/app/apps/klok/klok.img
cache:
paths:
- repos
reuse:
stage: build
image:
name: fsfe/reuse:latest
entrypoint: [""]
script:
- reuse lint
needs: []
conventional-commits:
stage: build
image: registry.gitlab.com/caspermeijn/docker-images/convco:latest
before_script:
- apt update && apt install -y git
script:
- git fetch origin
- convco check origin/master..HEAD
needs: []
package:
stage: package
image: python:3.8
before_script:
- pip install adafruit-nrfutil
script:
- cp bin/targets/klok-pinetime-release/app/apps/klok/klok.img klok.img
- mkdir dfu && pushd dfu
- cp ../klok.img klok_dfu.bin
- adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application klok_dfu.bin klok_dfu.zip
- popd
- echo "RELEASE_BASE_URL=https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/jobs/$CI_JOB_ID/artifacts/" > release_info
- echo "RELEASE_SHA=$CI_COMMIT_SHA" >> release_info
- echo "RELEASE_VERSION=$(<.next-version)" >> release_info
needs:
- version
- build
artifacts:
paths:
- release_info
- klok.img
- dfu/klok_dfu.bin
- dfu/klok_dfu.zip
release:
stage: release
image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1
script:
- . release_info
- release -v
- release tag
when: manual
only:
- master
deploy:
stage: release
image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1
script:
- . release_info
- release -v
- release --ci-commit-tag v$RELEASE_VERSION add-download-link -n "Klok PineTime image" -u ${RELEASE_BASE_URL}/klok.img -d "Klok PineTime image v$RELEASE_VERSION"
- release --ci-commit-tag v$RELEASE_VERSION add-download-link -n "Klok PineTime dfu binary" -u ${RELEASE_BASE_URL}/dfu/klok_dfu.bin -d "Klok PineTime dfu binary v$RELEASE_VERSION"
- release --ci-commit-tag v$RELEASE_VERSION add-download-link -n "Klok PineTime dfu distribution zip" -u ${RELEASE_BASE_URL}/dfu/klok_dfu.zip -d "Klok PineTime dfu distribution zip v$RELEASE_VERSION"
only:
- tags
rustfmt:
stage: build
image: registry.gitlab.com/caspermeijn/docker-images/pinetime-build:latest
script:
- newt upgrade mynewt-rust
- cd apps/klok && cargo fmt --all -- --check
needs: []