-
Notifications
You must be signed in to change notification settings - Fork 17
266 lines (228 loc) · 9.8 KB
/
release.yaml
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
name: Build
# Runs every Tuesday at 9 am UTC
on:
schedule:
- cron: '0 9 * * 2'
workflow_dispatch:
env:
GO111MODULE: on
permissions:
# This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on.
# More info: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings
id-token: write
contents: read # This is required for actions/checkout
jobs:
macos-arm64-build:
runs-on: [self-hosted, macos, arm64, 12, release]
timeout-minutes: 120
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
submodules: recursive
persist-credentials: false
- name: 'Fetch submodule tags'
run: |
git submodule foreach --recursive git fetch --tags
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: 1.22.x
- name: Install dependencies
# QEMU: required by Lima itself
# bash: required by test-example.sh (OS version of bash is too old)
# coreutils: required by test-example.sh for the "timeout" command
# autoconf: required for building vde
# automake: required for building vde
# FileMonitor: required to capture opened files by limactl and qemu-
run: |
brew update
brew install qemu bash coreutils
brew install autoconf automake
brew install cpanm
brew upgrade
sudo cpanm install JSON
bash bin/install-file-monitor.sh
shell: zsh {0}
- name: Make and release deps
run: |
(cd src/lima && git clean -f -d)
make -C src/lima PREFIX=/opt/homebrew all install
./bin/lima-and-qemu.pl
mv src/lima/lima-and-qemu.tar.gz src/lima/lima-and-qemu.macos-aarch64.tar.gz
shell: zsh {0}
- name: Upload MacOS build
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: lima-and-qemu.macos-arm64
path: ./src/lima/lima-and-qemu.macos*
if-no-files-found: error
- name: Make and release source code of dependencies
run: make download-sources
- name: Upload MacOS build
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: DependenciesSourceCode.tar.gz
path: ./downloads/dependency-sources.tar.gz
if-no-files-found: error
macos-x86-build:
runs-on: [self-hosted, macos, amd64, 12, release]
timeout-minutes: 120
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
submodules: recursive
persist-credentials: false
- name: 'Fetch submodule tags'
run: |
git submodule foreach --recursive git fetch --tags
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: 1.22.x
- name: Install dependencies
# QEMU: required by Lima itself
# bash: required by test-example.sh (OS version of bash is too old)
# coreutils: required by test-example.sh for the "timeout" command
# autoconf: required for building vde
# automake: required for building vde
# FileMonitor: required to capture opened files by limactl and qemu-
run: |
brew update
brew install qemu bash coreutils
brew install autoconf automake
brew install cpanm
brew upgrade
sudo cpanm install JSON
bash bin/install-file-monitor.sh
shell: zsh {0}
- name: Make and release deps
run: |
(cd src/lima && git clean -f -d)
make -C src/lima PREFIX=/usr/local all install
./bin/lima-and-qemu.pl
mv src/lima/lima-and-qemu.tar.gz src/lima/lima-and-qemu.macos-x86_64.tar.gz
shell: zsh {0}
- name: Upload MacOS build
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: lima-and-qemu.macos-x86
path: ./src/lima/lima-and-qemu.macos*
if-no-files-found: error
macos-arm64-ventura-build:
runs-on: [self-hosted, macos, arm64, 13, release]
timeout-minutes: 60
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
submodules: recursive
persist-credentials: false
- name: 'Fetch submodule tags'
run: |
git submodule foreach --recursive git fetch --tags
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: 1.22.x
- name: Create Ventura limactl tarball
working-directory: src/lima
run: |
make clean && make exe
tar cfz limactl.ventura.arm64.tar.gz -C _output/bin limactl
- name: Upload Ventura build
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: limactl.ventura.arm64
path: src/lima/limactl.ventura.arm64.tar.gz
if-no-files-found: error
macos-x86_64-ventura-build:
runs-on: [self-hosted, macos, amd64, 13, release]
timeout-minutes: 60
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
submodules: recursive
persist-credentials: false
- name: 'Fetch submodule tags'
run: |
git submodule foreach --recursive git fetch --tags
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: 1.22.x
- name: Create Ventura limactl tarball
working-directory: src/lima
run: |
make clean && make exe
tar cfz limactl.ventura.x86_64.tar.gz -C _output/bin limactl
- name: Upload Ventura build
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: limactl.ventura.x86_64
path: src/lima/limactl.ventura.x86_64.tar.gz
if-no-files-found: error
release:
runs-on: ubuntu-latest
timeout-minutes: 10
needs:
- macos-x86-build
- macos-arm64-build
- macos-x86_64-ventura-build
- macos-arm64-ventura-build
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
persist-credentials: false
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ secrets.ROLE }}
role-session-name: dependency-upload-session
aws-region: ${{ secrets.REGION }}
- name: Download MacOS ARM64 build
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: lima-and-qemu.macos-arm64
path: build
- name: Download MacOS x86_64 build
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: lima-and-qemu.macos-x86
path: build
- name: Download MacOS ARM64 Ventura build
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: limactl.ventura.arm64
path: build
- name: Download MacOS x86_64 Ventura build
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: limactl.ventura.x86_64
path: build
- name: Generate Timestamp
id: timestamp
run: echo "value=$(date +%s)" >> $GITHUB_OUTPUT
- name: Add Ventura builds to tarballs
run: |
timestamp=${{ steps.timestamp.outputs.value }}
mkdir -p build/lima-and-qemu.macos-aarch64/bin
tar -xzf build/lima-and-qemu.macos-aarch64.tar.gz -C build/lima-and-qemu.macos-aarch64
tar -xzf build/limactl.ventura.arm64.tar.gz -C build/lima-and-qemu.macos-aarch64/bin
tar -czf build/lima-and-qemu.macos-aarch64.${timestamp}.tar.gz -C build/lima-and-qemu.macos-aarch64 .
sha512sum build/lima-and-qemu.macos-aarch64.${timestamp}.tar.gz | cut -d " " -f 1 > build/lima-and-qemu.macos-aarch64.${timestamp}.tar.gz.sha512sum
mkdir -p build/lima-and-qemu.macos-x86_64/bin
tar -xzf build/lima-and-qemu.macos-x86_64.tar.gz -C build/lima-and-qemu.macos-x86_64
tar -xzf build/limactl.ventura.x86_64.tar.gz -C build/lima-and-qemu.macos-x86_64/bin
tar -czf build/lima-and-qemu.macos-x86_64.${timestamp}.tar.gz -C build/lima-and-qemu.macos-x86_64 .
sha512sum build/lima-and-qemu.macos-x86_64.${timestamp}.tar.gz | cut -d " " -f 1 > build/lima-and-qemu.macos-x86_64.${timestamp}.tar.gz.sha512sum
- name: Download MacOS dependencies' sources
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: DependenciesSourceCode.tar.gz
path: build
- name: 'Upload to S3'
run: |
timestamp=${{ steps.timestamp.outputs.value }}
aws s3 cp ./build/ s3://${{ secrets.DEPENDENCY_BUCKET_NAME }}/aarch64/ --recursive --exclude "*" --include "lima-and-qemu.macos-aarch64.${timestamp}.tar.gz*"
aws s3 cp ./build/ s3://${{ secrets.DEPENDENCY_BUCKET_NAME }}/x86-64/ --recursive --exclude "*" --include "lima-and-qemu.macos-x86_64.${timestamp}.tar.gz*"
aws s3 cp ./build/ s3://${{ secrets.DEPENDENCY_BUCKET_NAME }} --recursive --exclude "*" --include "dependency-sources.tar.gz"