Repository navigation
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
152 lines (142 loc) · 4.22 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
152 lines (142 loc) · 4.22 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_MESSAGE !~ /^norun/i'
when: always
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main" && $CI_COMMIT_MESSAGE !~ /^norun/i'
when: always
- if: $CI_COMMIT_TAG
when: always
- when: never
stages:
- drc
- production
- schematic
- package
- release
.env_template: &env_template
image: registry.gitlab.com/why2025/team-badge/hardware:latest
# DRC jobs
drc_carrier:
stage: drc
<<: *env_template
script:
- make drc_carrier
drc_m2:
stage: drc
<<: *env_template
script:
- make drc_m2
# Gerber jobs
production_carrier:
stage: production
<<: *env_template
needs:
- drc_carrier
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"'
- if: $CI_COMMIT_TAG
script:
- make gerbers_carrier
- make pdfs_carrier
artifacts:
paths:
- ./Carrier/production/
- ./Carrier/pdfs/
expire_in: 1 month
production_m2:
stage: production
<<: *env_template
needs:
- drc_m2
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"'
- if: $CI_COMMIT_TAG
script:
- make gerbers_m2
- make pdfs_m2
artifacts:
paths:
- ./M2/production/
- ./M2/pdfs/
expire_in: 1 month
# Schematic jobs
schematic_carrier:
stage: schematic
<<: *env_template
needs:
- production_carrier
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"'
- if: $CI_COMMIT_TAG
script:
- make schematic_carrier
artifacts:
paths:
- ./Carrier/pdfs/schematic.pdf
expire_in: 1 month
schematic_m2:
stage: schematic
<<: *env_template
needs:
- production_m2
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"'
- if: $CI_COMMIT_TAG
script:
- make schematic_m2
artifacts:
paths:
- ./M2/pdfs/schematic.pdf
expire_in: 1 month
# Package job
package:
stage: package
image: curlimages/curl:latest
needs:
- production_carrier
- production_m2
- schematic_carrier
- schematic_m2
rules:
- if: $CI_COMMIT_TAG
script:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file M2/pdfs/schematic.pdf "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/export/$CI_COMMIT_TAG/m2_schematic.pdf"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file Carrier/pdfs/schematic.pdf "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/export/$CI_COMMIT_TAG/carrier_schematic.pdf"'
- |
tar -czf m2_production.tar.gz M2/production M2/pdfs
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" \
--upload-file m2_production.tar.gz \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/export/${CI_COMMIT_TAG}/m2_production.tar.gz"
- |
tar -czf carrier_production.tar.gz Carrier/production Carrier/pdfs
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" \
--upload-file carrier_production.tar.gz \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/export/${CI_COMMIT_TAG}/carrier_production.tar.gz"
# Release job
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- package
rules:
- if: $CI_COMMIT_TAG
script:
- echo "Running release job for $CI_COMMIT_TAG"
release:
tag_name: '$CI_COMMIT_TAG'
name: '$CI_COMMIT_TAG'
description: 'Export for tag: $CI_COMMIT_TAG - $CI_COMMIT_TAG_MESSAGE'
assets:
links:
- name: 'Carrier Production Files'
url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/export/$CI_COMMIT_TAG/carrier_production.tar.gz'
link_type: 'package'
- name: 'M2 Production Files'
url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/export/$CI_COMMIT_TAG/m2_production.tar.gz'
link_type: 'package'
- name: 'Carrier Schematic PDF'
url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/export/$CI_COMMIT_TAG/carrier_schematic.pdf'
link_type: 'package'
- name: 'M2 Schematic PDF'
url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/export/$CI_COMMIT_TAG/m2_schematic.pdf'
link_type: 'package'