-
-
Notifications
You must be signed in to change notification settings - Fork 22
274 lines (264 loc) · 10.8 KB
/
dev-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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
name: Create Dev Releases
on:
push:
branches:
- main
- 'preview-**'
jobs:
package:
runs-on: ${{ matrix.runner }}
env:
TERM: xterm
strategy:
fail-fast: false
matrix:
node-version:
- '20'
os:
- linux
- macos
- win
runner:
- macos-14
- ubuntu-24.04
type:
- '-slim'
- ''
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm clean-install --prefer-offline --frozen-lockfile --production
- name: Install fatcore
if: matrix.type == ''
run: scripts/fatcore-install.sh --edge
- name: Switch to edge channel
run: |
sed -i.bak "s/^channel: stable/channel: edge/" config.yml
rm -rf config.yml.bak
- name: Prepare Release
uses: lando/prepare-release-action@v3
with:
version: dev
sync: false
- name: Package into node binary
uses: lando/pkg-action@v5
with:
entrypoint: bin/lando
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
options: --options dns-result-order=ipv4first
pkg: "@yao-pkg/[email protected]"
upload-key: "lando-${{ matrix.os }}-${{ matrix.runner == 'macos-14' && 'arm64' || 'x64' }}${{ matrix.type }}-${{ github.sha }}"
- name: Ensure version
if: (matrix.os == 'linux' && runner.os == 'Linux') || (matrix.os == 'macos' && runner.os == 'macOS')
run: ./dist/@lando/core version --all
- name: Ensure ipv4first
if: (matrix.os == 'linux' && runner.os == 'Linux') || (matrix.os == 'macos' && runner.os == 'macOS')
run: ./dist/@lando/core config --path cli.args | grep dns-result-order=ipv4first
- name: Ensure edge channel
if: (matrix.os == 'linux' && runner.os == 'Linux') || (matrix.os == 'macos' && runner.os == 'macOS')
run: ./dist/@lando/core config --path channel | grep edge
- name: Ensure slimcore
if: ((matrix.os == 'linux' && runner.os == 'Linux') || (matrix.os == 'macos' && runner.os == 'macOS')) && matrix.type == '-slim'
run: ./dist/@lando/core config --path fatcore | grep false
- name: Ensure fatcore
if: ((matrix.os == 'linux' && runner.os == 'Linux') || (matrix.os == 'macos' && runner.os == 'macOS')) && matrix.type == ''
run: |
./dist/@lando/core config --path fatcore | grep true
./dist/@lando/core config | grep -q "node_modules/@lando/wordpress"
sign-n-deploy:
runs-on: ${{ matrix.os }}
needs:
- package
env:
TERM: xterm
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
key: lando-win-x64-${{ github.sha }}
file: lando/core.exe
certificate-data: KEYLOCKER_CLIENT_CERT
certificate-password: KEYLOCKER_CLIENT_CERT_PASSWORD
result: lando-win-x64-${{ github.ref_name }}.exe
- os: windows-2022
key: lando-win-arm64-${{ github.sha }}
file: lando/core.exe
certificate-data: KEYLOCKER_CLIENT_CERT
certificate-password: KEYLOCKER_CLIENT_CERT_PASSWORD
result: lando-win-arm64-${{ github.ref_name }}.exe
- os: windows-2022
key: lando-win-x64-slim-${{ github.sha }}
file: lando/core.exe
certificate-data: KEYLOCKER_CLIENT_CERT
certificate-password: KEYLOCKER_CLIENT_CERT_PASSWORD
result: lando-win-x64-${{ github.ref_name }}-slim.exe
- os: windows-2022
key: lando-win-arm64-slim-${{ github.sha }}
file: lando/core.exe
certificate-data: KEYLOCKER_CLIENT_CERT
certificate-password: KEYLOCKER_CLIENT_CERT_PASSWORD
result: lando-win-arm64-${{ github.ref_name }}-slim.exe
- os: macos-14
key: lando-macos-x64-${{ github.sha }}
file: lando/core
certificate-data: APPLE_CERT_DATA
certificate-password: APPLE_CERT_PASSWORD
apple-product-id: dev.lando.cli
apple-team-id: FY8GAUX282
apple-notary-user: APPLE_NOTARY_USER
apple-notary-password: APPLE_NOTARY_PASSWORD
options: --options runtime --entitlements entitlements.xml
result: lando-macos-x64-${{ github.ref_name }}
- os: macos-14
key: lando-macos-arm64-${{ github.sha }}
file: lando/core
certificate-data: APPLE_CERT_DATA
certificate-password: APPLE_CERT_PASSWORD
apple-product-id: dev.lando.cli
apple-team-id: FY8GAUX282
apple-notary-user: APPLE_NOTARY_USER
apple-notary-password: APPLE_NOTARY_PASSWORD
options: --options runtime --entitlements entitlements.xml
result: lando-macos-arm64-${{ github.ref_name }}
- os: macos-14
key: lando-macos-x64-slim-${{ github.sha }}
file: lando/core
certificate-data: APPLE_CERT_DATA
certificate-password: APPLE_CERT_PASSWORD
apple-product-id: dev.lando.cli
apple-team-id: FY8GAUX282
apple-notary-user: APPLE_NOTARY_USER
apple-notary-password: APPLE_NOTARY_PASSWORD
options: --options runtime --entitlements entitlements.xml
result: lando-macos-x64-${{ github.ref_name }}-slim
- os: macos-14
key: lando-macos-arm64-slim-${{ github.sha }}
file: lando/core
certificate-data: APPLE_CERT_DATA
certificate-password: APPLE_CERT_PASSWORD
apple-product-id: dev.lando.cli
apple-team-id: FY8GAUX282
apple-notary-user: APPLE_NOTARY_USER
apple-notary-password: APPLE_NOTARY_PASSWORD
options: --options runtime --entitlements entitlements.xml
result: lando-macos-arm64-${{ github.ref_name }}-slim
- os: ubuntu-24.04
key: lando-linux-x64-${{ github.sha }}
file: lando/core
certificate-data: KEYLOCKER_CLIENT_CERT
certificate-password: KEYLOCKER_CLIENT_CERT_PASSWORD
result: lando-linux-x64-${{ github.ref_name }}
- os: ubuntu-24.04
key: lando-linux-arm64-${{ github.sha }}
file: lando/core
certificate-data: KEYLOCKER_CLIENT_CERT
certificate-password: KEYLOCKER_CLIENT_CERT_PASSWORD
result: lando-linux-arm64-${{ github.ref_name }}
- os: ubuntu-24.04
key: lando-linux-x64-slim-${{ github.sha }}
file: lando/core
certificate-data: KEYLOCKER_CLIENT_CERT
certificate-password: KEYLOCKER_CLIENT_CERT_PASSWORD
result: lando-linux-x64-${{ github.ref_name }}-slim
- os: ubuntu-24.04
key: lando-linux-arm64-slim-${{ github.sha }}
file: lando/core
certificate-data: KEYLOCKER_CLIENT_CERT
certificate-password: KEYLOCKER_CLIENT_CERT_PASSWORD
result: lando-linux-arm64-${{ github.ref_name }}-slim
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download ${{ matrix.key }}
uses: actions/download-artifact@v3
with:
name: ${{ matrix.key }}
path: lando
- name: Sign and Notarize
uses: lando/code-sign-action@v2
id: code-sign-action
with:
file: ${{ matrix.file }}
certificate-data: ${{ secrets[matrix.certificate-data] }}
certificate-password: ${{ secrets[matrix.certificate-password] }}
apple-notary-user: ${{ secrets[matrix.apple-notary-user] }}
apple-notary-password: ${{ secrets[matrix.apple-notary-password] }}
apple-product-id: ${{ matrix.apple-product-id }}
apple-team-id: ${{ matrix.apple-team-id }}
keylocker-host: https://clientauth.one.digicert.com
keylocker-api-key: ${{ secrets.KEYLOCKER_API_KEY }}
keylocker-cert-sha1-hash: ${{ secrets.KEYLOCKER_CERT_SHA1_HASH }}
keylocker-keypair-alias: ${{ secrets.KEYLOCKER_KEYPAIR_ALIAS }}
options: ${{ matrix.options }}
- name: Rename as needed
shell: bash
run: |
# naming things
mkdir -p releases
cp ${{ steps.code-sign-action.outputs.file }} releases/${{ matrix.result }}
cp releases/${{ matrix.result }} "releases/$(echo ${{ matrix.result }} | sed 's/${{ github.ref_name }}/latest/;')"
cp releases/${{ matrix.result }} "releases/$(echo ${{ matrix.result }} | sed 's/${{ github.ref_name }}/dev/;')"
# exec and confirm
chmod +x releases/*
ls -lsa releases
- name: Configure S3 Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Upload dev releases to S3
shell: bash
run: |
aws s3 sync releases s3://files.lando.dev
aws s3 sync releases s3://files.lando.dev/cli
aws s3 sync releases s3://files.lando.dev/core
- name: Upload to artifacts
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: ${{ matrix.key }}
overwrite: true
path: releases/*
verify:
runs-on: ubuntu-24.04
needs:
- sign-n-deploy
env:
TERM: xterm
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download for checksumming
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Combine artifacts
run: |
mkdir -p dist
find "artifacts" -mindepth 2 -maxdepth 2 -type f -exec mv {} "dist" \;
ls -lsa dist
- name: Checksum artifacts
run: ./scripts/generate-checksums.sh --directory dist --output checksums-dev-${{ github.sha }}.txt --show
- name: Configure S3 Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Upload Checksums to S3
shell: bash
run: |
aws s3 cp checksums-dev-${{ github.sha }}.txt s3://files.lando.dev/
aws s3 cp checksums-dev-${{ github.sha }}.txt s3://files.lando.dev/cli/
aws s3 cp checksums-dev-${{ github.sha }}.txt s3://files.lando.dev/core/