-
Notifications
You must be signed in to change notification settings - Fork 239
598 lines (565 loc) · 24.6 KB
/
prerelease.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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
on:
push:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create prerelease w/ binaries and docker image
jobs:
build-push-porter:
runs-on: ubuntu-latest
steps:
- name: Get tag name
id: tag_name
run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
env:
GITHUB_TAG: ${{ github.ref }}
- name: Checkout
uses: actions/checkout@v3
- name: Setup docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Write Dashboard Environment Variables
run: |
cat >./dashboard/.env <<EOL
NODE_ENV=production
APPLICATION_CHART_REPO_URL=https://charts.getporter.dev
ADDON_CHART_REPO_URL=https://chart-addons.getporter.dev
EOL
cat ./dashboard/.env
- name: Build
run: |
DOCKER_BUILDKIT=1 docker build . -t porter1/porter:${{steps.tag_name.outputs.tag}} -f ./ee/docker/ee.Dockerfile --build-arg version=${{steps.tag_name.outputs.tag}}
- name: Push
run: |
docker push porter1/porter:${{steps.tag_name.outputs.tag}}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Login to ECR public
id: login-ecr
run: |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/o1j4x7p4
- name: Push to ECR public
run: |
docker tag porter1/porter:${{steps.tag_name.outputs.tag}} public.ecr.aws/o1j4x7p4/porter:${{steps.tag_name.outputs.tag}}
docker push public.ecr.aws/o1j4x7p4/porter:${{steps.tag_name.outputs.tag}}
build-push-provisioner:
runs-on: ubuntu-latest
steps:
- name: Get tag name
id: tag_name
run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
env:
GITHUB_TAG: ${{ github.ref }}
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Login to ECR public
id: login-ecr
run: |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/o1j4x7p4
- name: Build
run: |
DOCKER_BUILDKIT=1 docker build . -t public.ecr.aws/o1j4x7p4/provisioner-service:${{steps.tag_name.outputs.tag}} -f ./ee/docker/provisioner.Dockerfile
- name: Push to ECR public
run: |
docker push public.ecr.aws/o1j4x7p4/provisioner-service:${{steps.tag_name.outputs.tag}}
build-push-worker-pool:
runs-on: ubuntu-latest
steps:
- name: Get tag name
id: tag_name
run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
env:
GITHUB_TAG: ${{ github.ref }}
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Login to ECR public
id: login-ecr
run: |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/o1j4x7p4
- name: Build
run: |
DOCKER_BUILDKIT=1 docker build . -t public.ecr.aws/o1j4x7p4/worker-pool:${{steps.tag_name.outputs.tag}} -f ./workers/Dockerfile
- name: Push to ECR public
run: |
docker push public.ecr.aws/o1j4x7p4/worker-pool:${{steps.tag_name.outputs.tag}}
build-linux:
name: Build Linux binaries
runs-on: ubuntu-latest
steps:
- name: Get tag name
id: tag_name
run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
env:
GITHUB_TAG: ${{ github.ref }}
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
cache: false
go-version: '1.20.5'
go-version-file: go.mod
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Write Dashboard Environment Variables
run: |
cat >./dashboard/.env <<EOL
NODE_ENV=production
APPLICATION_CHART_REPO_URL=https://charts.getporter.dev
ADDON_CHART_REPO_URL=https://chart-addons.getporter.dev
EOL
- name: Build and zip static folder
run: |
mkdir -p ./release/static
cd dashboard
npm i --production=false --legacy-peer-deps
npm run build
cd ..
zip --junk-paths ./release/static/static_${{steps.tag_name.outputs.tag}}.zip ./dashboard/build/*
env:
NODE_ENV: production
NODE_OPTIONS: --openssl-legacy-provider
- name: Build Linux binaries
run: |
go build -ldflags="-w -s -X 'github.com/porter-dev/porter/cli/cmd/config.Version=${{steps.tag_name.outputs.tag}}' -X 'github.com/porter-dev/porter/cli/cmd/errors.SentryDSN=${{secrets.SENTRY_DSN}}'" -a -tags cli -o ./porter ./cli &
go build -ldflags="-w -s -X 'main.Version=${{steps.tag_name.outputs.tag}}'" -a -o ./docker-credential-porter ./cmd/docker-credential-porter/ &
go build -ldflags="-w -s -X 'main.Version=${{steps.tag_name.outputs.tag}}'" -a -tags ee -o ./portersvr ./cmd/app/ &
wait
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 0
# Note: we have to zip all binaries before uploading them as artifacts --
# without this step, the binaries will be uploaded but the file metadata will
# be listed as plaintext after downloading the artifact in a later step
#
# TODO: investigate
- name: Zip Linux binaries
run: |
mkdir -p ./release/linux
zip --junk-paths ./release/linux/porter_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip ./porter
zip --junk-paths ./release/linux/portersvr_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip ./portersvr
zip --junk-paths ./release/linux/docker-credential-porter_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip ./docker-credential-porter
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
path: ./release/linux
name: linux-binaries
retention-days: 1
- name: Upload static binaries
uses: actions/upload-artifact@v3
with:
path: ./release/static
name: static-binaries
retention-days: 1
build-mac:
name: Build MacOS binaries
runs-on: macos-11
steps:
- name: Get tag name
id: tag_name
run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
env:
GITHUB_TAG: ${{ github.ref }}
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
cache: false
go-version: '1.20.5'
go-version-file: go.mod
- name: Write Dashboard Environment Variables
run: |
cat >./dashboard/.env <<EOL
NODE_ENV=production
APPLICATION_CHART_REPO_URL=https://charts.getporter.dev
ADDON_CHART_REPO_URL=https://chart-addons.getporter.dev
EOL
- name: Build and Zip MacOS amd64 binaries
run: |
go build -ldflags="-w -s -X 'github.com/porter-dev/porter/cli/cmd/config.Version=${{steps.tag_name.outputs.tag}}' -X 'github.com/porter-dev/porter/cli/cmd/errors.SentryDSN=${{secrets.SENTRY_DSN}}'" -a -tags cli -o ./amd64/porter ./cli &
go build -ldflags="-w -s -X 'main.Version=${{steps.tag_name.outputs.tag}}'" -a -o ./amd64/docker-credential-porter ./cmd/docker-credential-porter/ &
go build -ldflags="-w -s -X 'main.Version=${{steps.tag_name.outputs.tag}}'" -a -tags ee -o ./amd64/portersvr ./cmd/app/ &
wait
mkdir -p ./release/darwin
zip --junk-paths ./release/darwin/UNSIGNED_porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip ./amd64/porter
zip --junk-paths ./release/darwin/UNSIGNED_portersvr_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip ./amd64/portersvr
zip --junk-paths ./release/darwin/UNSIGNED_docker-credential-porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip ./amd64/docker-credential-porter
env:
GOOS: darwin
GOARCH: amd64
CGO_ENABLED: 0
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
path: ./release/darwin
name: mac-binaries
retention-days: 1
notarize:
name: Notarize Darwin binaries
runs-on: macos-11
needs: build-mac
steps:
- name: Get tag name
id: tag_name
run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
env:
GITHUB_TAG: ${{ github.ref }}
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: mac-binaries
path: release/
- name: Unzip Darwin binaries
run: |
unzip ./release/UNSIGNED_porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
unzip ./release/UNSIGNED_portersvr_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
unzip ./release/UNSIGNED_docker-credential-porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v2
with:
# The certificates in a PKCS12 file encoded as a base64 string
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
# The password used to import the PKCS12 file.
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
- name: Install gon via HomeBrew for code signing and app notarization
run: |
brew tap porter-dev/gon
brew install porter-dev/gon/gon
- name: Create a porter.gon.json file
run: |
echo "
{
\"source\": [\"./porter\"],
\"bundle_id\": \"cli.porter\",
\"apple_id\": {
\"password\": \"@env:AC_PASSWORD\"
},
\"sign\": {
\"application_identity\": \"${{ secrets.AC_APPLICATION_IDENTITY }}\"
},
\"zip\": {
\"output_path\": \"./release/porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip\"
}
}
" > ./porter.gon.json
- name: Create a portersvr.gon.json file
run: |
echo "
{
\"source\": [\"./portersvr\"],
\"bundle_id\": \"cli.portersvr\",
\"apple_id\": {
\"password\": \"@env:AC_PASSWORD\"
},
\"sign\": {
\"application_identity\": \"${{ secrets.AC_APPLICATION_IDENTITY }}\"
},
\"zip\": {
\"output_path\": \"./release/portersvr_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip\"
}
}
" > ./portersvr.gon.json
- name: Create a docker-credential-porter.gon.json file
run: |
echo "
{
\"source\": [\"./docker-credential-porter\"],
\"bundle_id\": \"cli.docker-credential-porter\",
\"apple_id\": {
\"password\": \"@env:AC_PASSWORD\"
},
\"sign\": {
\"application_identity\": \"${{ secrets.AC_APPLICATION_IDENTITY }}\"
},
\"zip\": {
\"output_path\": \"./release/docker-credential-porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip\"
}
}
" > ./docker-credential-porter.gon.json
- name: Sign the mac binaries with Gon
env:
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
run: |
gon ./porter.gon.json &
gon ./portersvr.gon.json &
gon ./docker-credential-porter.gon.json &
wait
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
path: ./release
name: mac-binaries
retention-days: 1
release:
name: Zip binaries, create release and upload assets
runs-on: ubuntu-latest
needs:
- notarize
- build-linux
steps:
- name: Get tag name
id: tag_name
run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
env:
GITHUB_TAG: ${{ github.ref }}
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: linux-binaries
path: release/linux
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: static-binaries
path: release/static
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: mac-binaries
path: release/darwin
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: true
- name: Upload Linux CLI Release Asset
id: upload-linux-cli-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TAG: ${{ github.ref }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/linux/porter_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip
asset_name: porter_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip
asset_content_type: application/zip
- name: Upload Linux Server Release Asset
id: upload-linux-server-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TAG: ${{ github.ref }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/linux/portersvr_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip
asset_name: portersvr_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip
asset_content_type: application/zip
- name: Upload Linux Docker Credential Release Asset
id: upload-linux-docker-cred-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TAG: ${{ github.ref }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/linux/docker-credential-porter_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip
asset_name: docker-credential-porter_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip
asset_content_type: application/zip
- name: Upload Darwin CLI Release Asset
id: upload-darwin-cli-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TAG: ${{ github.ref }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/darwin/porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
asset_name: porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
asset_content_type: application/zip
- name: Upload Darwin Server Release Asset
id: upload-darwin-server-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TAG: ${{ github.ref }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/darwin/portersvr_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
asset_name: portersvr_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
asset_content_type: application/zip
- name: Upload Darwin Docker Credential Release Asset
id: upload-darwin-docker-cred-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TAG: ${{ github.ref }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/darwin/docker-credential-porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
asset_name: docker-credential-porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
asset_content_type: application/zip
- name: Upload Static Release Asset
id: upload-static-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TAG: ${{ github.ref }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/static/static_${{steps.tag_name.outputs.tag}}.zip
asset_name: static_${{steps.tag_name.outputs.tag}}.zip
asset_content_type: application/zip
build-push-docker-cli:
name: Build a new porter-cli docker image
runs-on: ubuntu-latest
needs: release
steps:
- name: Get tag name
id: tag_name
run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
env:
GITHUB_TAG: ${{ github.ref }}
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Login to ECR public
id: login-ecr
run: |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/o1j4x7p4
- name: Login to GHCR
id: login-ghcr
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build
run: |
docker build ./services/porter_cli_container \
-t public.ecr.aws/o1j4x7p4/porter-cli:${{steps.tag_name.outputs.tag}} \
-f ./services/porter_cli_container/Dockerfile \
--build-arg VERSION=${{steps.tag_name.outputs.tag}} \
--build-arg SENTRY_DSN=${{secrets.SENTRY_DSN}}
- name: Push to ECR public
run: docker push public.ecr.aws/o1j4x7p4/porter-cli:${{steps.tag_name.outputs.tag}}
- name: Push to GHCR
run: |
docker tag public.ecr.aws/o1j4x7p4/porter-cli:${{steps.tag_name.outputs.tag}} ghcr.io/porter-dev/porter/porter-cli:${{steps.tag_name.outputs.tag}}
docker push ghcr.io/porter-dev/porter/porter-cli:${{steps.tag_name.outputs.tag}}
update-porter-update-action:
name: Update porter-update-action
runs-on: ubuntu-latest
needs: build-push-docker-cli
steps:
- name: Get tag name
id: tag_name
run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
env:
GITHUB_TAG: ${{ github.ref }}
- name: Push new branch with updated CLI
run: |
cd $GITHUB_WORKSPACE
git clone https://portersupport:${{ secrets.PORTER_DEV_GITHUB_TOKEN }}@github.com/porter-dev/porter-update-action
cd porter-update-action
git checkout -B "${{steps.tag_name.outputs.tag}}"
cat >Dockerfile <<EOL
FROM ghcr.io/porter-dev/porter/porter-cli:${{steps.tag_name.outputs.tag}}
LABEL org.opencontainers.image.source="https://github.com/porter-dev/porter"
COPY entrypoint.sh /action/
ENTRYPOINT ["/action/entrypoint.sh"]
EOL
git config user.name "Update Bot"
git config user.email "[email protected]"
git add .
git commit -m "Update to CLI version ${{steps.tag_name.outputs.tag}}"
git push --set-upstream origin ${{steps.tag_name.outputs.tag}} -f
update-porter-cli-action:
name: Update porter-cli-action
runs-on: ubuntu-latest
needs: build-push-docker-cli
steps:
- name: Get tag name
id: tag_name
run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
env:
GITHUB_TAG: ${{ github.ref }}
- name: Push new branch with updated CLI
run: |
cd $GITHUB_WORKSPACE
git clone https://portersupport:${{ secrets.PORTER_DEV_GITHUB_TOKEN }}@github.com/porter-dev/porter-cli-action
cd porter-cli-action
git checkout -B "${{steps.tag_name.outputs.tag}}"
cat >Dockerfile <<EOL
FROM ghcr.io/porter-dev/porter/porter-cli:${{steps.tag_name.outputs.tag}}
LABEL org.opencontainers.image.source="https://github.com/porter-dev/porter"
COPY entrypoint.sh /action/
ENTRYPOINT ["/action/entrypoint.sh"]
EOL
git config user.name "Update Bot"
git config user.email "[email protected]"
git add .
git commit -m "Update to CLI version ${{steps.tag_name.outputs.tag}}"
git push --set-upstream origin ${{steps.tag_name.outputs.tag}} -f
update-new-release-tests:
name: Update new-release-tests
runs-on: ubuntu-latest
needs: [update-porter-update-action, update-porter-cli-action]
steps:
- name: Get tag name
id: tag_name
run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
env:
GITHUB_TAG: ${{ github.ref }}
- name: Update new-release-tests
run: |
cd $GITHUB_WORKSPACE
git clone https://portersupport:${{ secrets.PORTER_DEV_GITHUB_TOKEN }}@github.com/porter-dev/new-release-tests
cd new-release-tests/.github/workflows
sed -i 's/uses: porter-dev\/porter-update-action.*/uses: porter-dev\/porter-update-action@${{ steps.tag_name.outputs.tag }}/g' porter_test_pack_production.yml
sed -i 's/uses: porter-dev\/porter-cli-action.*/uses: porter-dev\/porter-cli-action@${{ steps.tag_name.outputs.tag }}/g' porter_test_pack_production.yml
sed -i 's/uses: porter-dev\/porter-update-action.*/uses: porter-dev\/porter-update-action@${{ steps.tag_name.outputs.tag }}/g' porter_test_docker_production.yml
sed -i 's/uses: porter-dev\/porter-cli-action.*/uses: porter-dev\/porter-cli-action@${{ steps.tag_name.outputs.tag }}/g' porter_test_docker_production.yml
sed -i 's/uses: porter-dev\/porter-update-action.*/uses: porter-dev\/porter-update-action@${{ steps.tag_name.outputs.tag }}/g' test_porter_cli.yml
sed -i 's/uses: porter-dev\/porter-cli-action.*/uses: porter-dev\/porter-cli-action@${{ steps.tag_name.outputs.tag }}/g' test_porter_cli.yml
cd ../..
git config user.name "Update Bot"
git config user.email "[email protected]"
git diff --quiet --exit-code || (git add . && git commit -m "Update to Porter GHA version ${{steps.tag_name.outputs.tag}}" && git push -f)
git checkout test-preview-env
git merge main -m "Merge with main"
sed -i 's/TEST:v.*/TEST:${{ steps.tag_name.outputs.tag }}/g' porter.yaml
git diff --quiet --exit-code || (git add . && git commit -m "Update to Porter GHA version ${{steps.tag_name.outputs.tag}}" && git push -f)
run-new-release-tests-workflows:
name: Run new-release-tests Porter workflows
runs-on: ubuntu-latest
needs: update-new-release-tests
steps:
- name: Run porter_test_pack_production.yml workflow
run: gh workflow run porter_test_pack_production.yml --repo porter-dev/new-release-tests
env:
GITHUB_TOKEN: ${{ secrets.PORTER_DEV_GITHUB_TOKEN }}
- name: Run porter_test_docker_production.yml workflow
run: gh workflow run porter_test_docker_production.yml --repo porter-dev/new-release-tests
env:
GITHUB_TOKEN: ${{ secrets.PORTER_DEV_GITHUB_TOKEN }}
- name: Run test_porter_cli.yml workflow
run: gh workflow run test_porter_cli.yml --repo porter-dev/new-release-tests
env:
GITHUB_TOKEN: ${{ secrets.PORTER_DEV_GITHUB_TOKEN }}