-
Notifications
You must be signed in to change notification settings - Fork 268
244 lines (206 loc) · 8.68 KB
/
release.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
on:
push:
paths-ignore:
- "**.md"
- "channel.yaml"
- "install.sh"
- "!.github/workflows/test-suite.yaml"
tags:
- "v*"
env:
GITHUB_ACTION_TAG: ${{ github.ref_name }}
GH_TOKEN: ${{ github.token }}
name: Release
permissions:
contents: write
id-token: write
jobs:
release-amd64:
runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }},image=ubuntu22-full-x64,hdd=256
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Dapper
run: |
curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper
chmod +x /usr/local/bin/dapper
- name: Validate Release
run: |
dapper -f Dockerfile --target dapper make validate-release
- name: Build
run: |
dapper -f Dockerfile --target dapper make dapper-ci
- name: "Read secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials password | DOCKER_PASSWORD ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials registry | PRIME_REGISTRY ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials username | PRIME_REGISTRY_USERNAME ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials password | PRIME_REGISTRY_PASSWORD
- name: Package Images
run: |
dapper -f Dockerfile --target dapper make package-images
- name: Scan Images
continue-on-error: true
run: |
dapper -f Dockerfile --target dapper make scan-images
- name: Test
run: |
dapper -f Dockerfile --target dapper make test
- name: Publish Image Runtime
uses: rancher/ecm-distro-tools/actions/publish-image@master
env:
GOARCH: amd64
GOOS: linux
with:
image: "rke2-runtime"
tag: ${{ github.ref_name }}
make-target: publish-image-runtime
public-repo: rancher
public-username: ${{ env.DOCKER_USERNAME }}
public-password: ${{ env.DOCKER_PASSWORD }}
prime-repo: rancher
prime-registry: ${{ env.PRIME_REGISTRY }}
prime-username: ${{ env.PRIME_REGISTRY_USERNAME }}
prime-password: ${{ env.PRIME_REGISTRY_PASSWORD }}
- name: Publish Image Runtime (Windows)
uses: rancher/ecm-distro-tools/actions/publish-image@master
env:
GOARCH: amd64
GOOS: linux
with:
image: "rke2-runtime"
tag: ${{ github.ref_name }}
make-target: publish-image-runtime-windows
public-repo: rancher
public-username: ${{ env.DOCKER_USERNAME }}
public-password: ${{ env.DOCKER_PASSWORD }}
prime-repo: rancher
prime-registry: ${{ env.PRIME_REGISTRY }}
prime-username: ${{ env.PRIME_REGISTRY_USERNAME }}
prime-password: ${{ env.PRIME_REGISTRY_PASSWORD }}
- name: Package windows images
run: |
GITHUB_ACTION_TAG=${{ github.ref_name }} dapper -f Dockerfile --target dapper make package-windows-images
- name: Checksum Artifacts
run: |
GITHUB_ACTION_TAG=${{ github.ref_name }} dapper -f Dockerfile --target dapper make checksum
- name: Publish Artifacts
run: |
dapper -f Dockerfile --target dapper make publish-binary
env:
GH_TOKEN: ${{ github.token }}
release-arm64:
runs-on: runs-on,runner=8cpu-linux-arm64,run-id=${{ github.run_id }},image=ubuntu22-full-arm64,hdd=256
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Dapper
run: |
curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper
chmod +x /usr/local/bin/dapper
- name: Validate Release
run: |
dapper -f Dockerfile --target dapper make validate-release
- name: Build
run: |
dapper -f Dockerfile --target dapper make dapper-ci
- name: "Read secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials password | DOCKER_PASSWORD ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials registry | PRIME_REGISTRY ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials username | PRIME_REGISTRY_USERNAME ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials password | PRIME_REGISTRY_PASSWORD ;
- name: Package Images
run: |
dapper -f Dockerfile --target dapper make package-images
- name: Scan Images
continue-on-error: true
run: |
dapper -f Dockerfile --target dapper make scan-images
- name: Publish Image Runtime
uses: rancher/ecm-distro-tools/actions/publish-image@master
env:
GOARCH: arm64
GOOS: linux
with:
image: "rke2-runtime"
tag: ${{ github.ref_name }}
make-target: publish-image-runtime
public-repo: rancher
public-username: ${{ env.DOCKER_USERNAME }}
public-password: ${{ env.DOCKER_PASSWORD }}
prime-repo: rancher
prime-registry: ${{ env.PRIME_REGISTRY }}
prime-username: ${{ env.PRIME_REGISTRY_USERNAME }}
prime-password: ${{ env.PRIME_REGISTRY_PASSWORD }}
- name: Checksum
run: |
GITHUB_ACTION_TAG=${{ github.ref_name }} dapper -f Dockerfile --target dapper make checksum
- name: Publish Artifacts
run: |
dapper -f Dockerfile --target dapper make publish-binary
env:
GH_TOKEN: ${{ github.token }}
manifest:
needs: [release-amd64, release-arm64]
runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }},image=ubuntu22-full-x64,hdd=64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Dapper
run: |
curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper
chmod +x /usr/local/bin/dapper
- name: "Read secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials password | DOCKER_PASSWORD ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials registry | PRIME_REGISTRY ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials username | PRIME_REGISTRY_USERNAME ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials password | PRIME_REGISTRY_PASSWORD ;
- name: Manifest
uses: rancher/ecm-distro-tools/actions/publish-image@master
env:
GOARCH: amd64
GOOS: linux
with:
image: "rke2-runtime"
tag: ${{ github.ref_name }}
make-target: publish-manifest-runtime
public-repo: rancher
public-username: ${{ env.DOCKER_USERNAME }}
public-password: ${{ env.DOCKER_PASSWORD }}
prime-repo: rancher
prime-registry: ${{ env.PRIME_REGISTRY }}
prime-username: ${{ env.PRIME_REGISTRY_USERNAME }}
prime-password: ${{ env.PRIME_REGISTRY_PASSWORD }}
dispatch:
needs: [release-amd64, release-arm64]
runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }},image=ubuntu22-full-x64,hdd=64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Dapper
run: |
curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper
chmod +x /usr/local/bin/dapper
- name: "Read secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/pat-username/credentials token | PAT_USERNAME ;
- name: Dispatch
run: |
dapper -f Dockerfile --target dapper make dispatch
env:
PAT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PAT_USERNAME: ${{ env.PAT_USERNAME }}
GITHUB_ACTION_TAG: ${{ env.GITHUB_ACTION_TAG }}