35
35
sudo apt-get update
36
36
sudo apt-get install -y libcurl4-openssl-dev
37
37
38
- - uses : actions/checkout@v4
38
+ - uses : actions/checkout@v5
39
39
with :
40
40
submodules : recursive
41
41
@@ -106,7 +106,7 @@ jobs:
106
106
sudo apt-get update
107
107
sudo apt-get install -y libcurl4-openssl-dev
108
108
109
- - uses : actions/checkout@v4
109
+ - uses : actions/checkout@v5
110
110
with :
111
111
submodules : recursive
112
112
@@ -127,7 +127,7 @@ jobs:
127
127
outputs :
128
128
devservices-files-changed : ${{ steps.changes.outputs.devservices-files-changed }}
129
129
steps :
130
- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
130
+ - uses : actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.1.7
131
131
- uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
132
132
name : Check for file changes
133
133
id : changes
@@ -156,7 +156,7 @@ jobs:
156
156
if : " !startsWith(github.ref, 'refs/heads/release-library/')"
157
157
158
158
steps :
159
- - uses : actions/checkout@v4
159
+ - uses : actions/checkout@v5
160
160
with :
161
161
submodules : recursive
162
162
@@ -210,7 +210,7 @@ jobs:
210
210
sudo apt-get update
211
211
sudo apt-get install -y libcurl4-openssl-dev
212
212
213
- - uses : actions/checkout@v4
213
+ - uses : actions/checkout@v5
214
214
with :
215
215
submodules : recursive
216
216
@@ -238,7 +238,7 @@ jobs:
238
238
runs-on : ubuntu-latest
239
239
240
240
steps :
241
- - uses : actions/checkout@v4
241
+ - uses : actions/checkout@v5
242
242
with :
243
243
submodules : recursive
244
244
@@ -354,7 +354,7 @@ jobs:
354
354
run : |
355
355
curl -sL https://sentry.io/get-cli/ | bash
356
356
357
- - uses : actions/checkout@v4
357
+ - uses : actions/checkout@v5
358
358
with :
359
359
submodules : recursive
360
360
@@ -430,7 +430,7 @@ jobs:
430
430
run : |
431
431
curl -sL https://sentry.io/get-cli/ | bash
432
432
433
- - uses : actions/checkout@v4
433
+ - uses : actions/checkout@v5
434
434
with :
435
435
submodules : recursive
436
436
@@ -481,6 +481,10 @@ jobs:
481
481
name : Build Docker Image
482
482
runs-on : ubuntu-latest
483
483
484
+ permissions :
485
+ contents : read
486
+ packages : write
487
+
484
488
strategy :
485
489
matrix :
486
490
image_name : ${{ fromJson(needs.build-setup.outputs.image_names) }}
@@ -491,7 +495,7 @@ jobs:
491
495
REVISION : " ${{ github.event.pull_request.head.sha || github.sha }}"
492
496
493
497
steps :
494
- - uses : actions/checkout@v4
498
+ - uses : actions/checkout@v5
495
499
496
500
- uses : docker/setup-qemu-action@v3
497
501
- uses : docker/setup-buildx-action@v3
@@ -503,26 +507,28 @@ jobs:
503
507
504
508
- name : Build and push to ghcr.io
505
509
if : " !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]'"
506
- run : |
507
- docker login --username '${{ github.actor }}' --password '${{ secrets.GITHUB_TOKEN }}' ghcr.io
508
-
509
- docker buildx build \
510
- --platform "${PLATFORMS}" \
511
- --tag "${DOCKER_IMAGE}:${REVISION}" \
512
- $( [[ "${IS_MASTER}" == "true" ]] && printf %s "--tag ${DOCKER_IMAGE}:nightly" ) \
513
- --file Dockerfile.release \
514
- --push \
515
- .
510
+ uses : getsentry/action-build-and-push-images@4852d671d747d7c0268b2a3fc429fee9d4a16f78
511
+ with :
512
+ image_name : ${{ matrix.image_name }}
513
+ platforms : ${{ env.PLATFORMS }}
514
+ dockerfile_path : " ./Dockerfile.release "
515
+ ghcr : true
516
+ tag_nightly : true
517
+ tag_latest : true
518
+ google_ar : false
519
+ publish_on_pr : true
516
520
517
521
- name : Build and publish docker artifact
518
522
if : " github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]'"
519
- run : |
520
- docker buildx build \
521
- --platform "${PLATFORMS}" \
522
- --tag "${DOCKER_IMAGE}:${REVISION}" \
523
- --file Dockerfile.release \
524
- --output type=docker,dest=${{ matrix.image_name }}-docker-image \
525
- .
523
+ uses : getsentry/action-build-and-push-images@4852d671d747d7c0268b2a3fc429fee9d4a16f78
524
+ with :
525
+ image_name : ${{ matrix.image_name }}
526
+ platforms : ${{ env.PLATFORMS }}
527
+ dockerfile_path : " ./Dockerfile.release"
528
+ ghcr : false
529
+ google_ar : false
530
+ outputs : " type=docker,dest=${{ matrix.image_name }}-docker-image"
531
+ tags : " ghcr.io/getsentry/${{ matrix.image_name }}:${{ github.event.pull_request.head.sha || github.sha }}"
526
532
527
533
- name : Upload docker image
528
534
if : " github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]'"
@@ -555,7 +561,7 @@ jobs:
555
561
if : " !startsWith(github.ref, 'refs/heads/release-library/') && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' && needs.build-setup.outputs.full_ci == 'true'"
556
562
557
563
steps :
558
- - uses : actions/checkout@v4
564
+ - uses : actions/checkout@v5
559
565
560
566
- uses : docker/setup-qemu-action@v3
561
567
- uses : docker/setup-buildx-action@v3
@@ -589,48 +595,18 @@ jobs:
589
595
done
590
596
591
597
- name : Build and push to Internal AR
592
- run : |
593
- docker buildx build \
594
- --platform "${PLATFORMS}" \
595
- --tag "${AR_DOCKER_IMAGE}:${REVISION}" \
596
- $( [[ "${IS_MASTER}" == "true" ]] && printf %s "--tag ${AR_DOCKER_IMAGE}:latest" ) \
597
- --file Dockerfile.release \
598
- --push \
599
- .
600
-
601
- publish-to-dockerhub :
602
- needs : [build-setup, build-docker]
603
-
604
- runs-on : ubuntu-22.04
605
- name : Publish Relay to DockerHub
606
-
607
- strategy :
608
- matrix :
609
- image_name : ["relay"] # Don't publish relay-pop (for now)
610
-
611
- if : github.event_name == 'merge_group'
612
-
613
- env :
614
- GHCR_DOCKER_IMAGE : " ghcr.io/getsentry/${{ matrix.image_name }}"
615
- DH_DOCKER_IMAGE : " getsentry/${{ matrix.image_name }}"
616
- REVISION : " ${{ github.event.pull_request.head.sha || github.sha }}"
617
-
618
- steps :
619
- - name : Login to DockerHub
620
- run : docker login --username=sentrybuilder --password ${{ secrets.DOCKER_HUB_RW_TOKEN }}
621
-
622
- - name : Copy Image from GHCR to DockerHub
623
- run : |
624
- # We push 3 tags to Dockerhub:
625
- # 1) the full sha of the commit
626
- docker buildx imagetools create --tag "${DH_DOCKER_IMAGE}:${REVISION}" "${GHCR_DOCKER_IMAGE}:${REVISION}"
627
-
628
- # 2) the short sha
629
- SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-8)
630
- docker buildx imagetools create --tag "${DH_DOCKER_IMAGE}:${SHORT_SHA}" "${GHCR_DOCKER_IMAGE}:${REVISION}"
631
-
632
- # 3) nightly
633
- docker buildx imagetools create --tag "${DH_DOCKER_IMAGE}:nightly" "${GHCR_DOCKER_IMAGE}:${REVISION}"
598
+ uses : getsentry/action-build-and-push-images@4852d671d747d7c0268b2a3fc429fee9d4a16f78
599
+ with :
600
+ image_name : ${{ matrix.image_name }}
601
+ platforms : ${{ env.PLATFORMS }}
602
+ dockerfile_path : " ./Dockerfile.release"
603
+ ghcr : false
604
+ publish_on_pr : true
605
+ tag_latest : true
606
+ google_ar : true
607
+ google_ar_image_name : ${{ env.AR_DOCKER_IMAGE }}
608
+ google_workload_identity_provider : projects/868781662168/locations/global/workloadIdentityPools/prod-github/providers/github-oidc-pool
609
+ google_service_account :
[email protected]
634
610
635
611
publish-to-gcr :
636
612
timeout-minutes : 5
@@ -792,7 +768,7 @@ jobs:
792
768
sudo apt-get update
793
769
sudo apt-get install -y libcurl4-openssl-dev
794
770
795
- - uses : actions/checkout@v4
771
+ - uses : actions/checkout@v5
796
772
with :
797
773
submodules : recursive
798
774
@@ -840,7 +816,7 @@ jobs:
840
816
steps :
841
817
# Checkout Sentry and run integration tests against latest Relay
842
818
- name : Checkout Sentry
843
- uses : actions/checkout@v4
819
+ uses : actions/checkout@v5
844
820
with :
845
821
repository : getsentry/sentry
846
822
path : sentry
0 commit comments