26
26
with :
27
27
ref : ${{ github.event.release.target_commitish }}
28
28
29
- - name : Prepare
30
- run : |
31
- platform=${{ matrix.platform }}
32
- echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
33
-
34
29
- name : Set up Docker Buildx
35
30
uses : docker/setup-buildx-action@v3
36
31
@@ -46,62 +41,38 @@ jobs:
46
41
context : .
47
42
target : prod
48
43
platforms : ${{ matrix.platform }}
44
+ push : true
49
45
tags : |
50
46
${{ env.REGISTRY_IMAGE }}:${{ github.event.release.tag_name }}-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
51
47
${{ env.LATEST_TAG != '' && format('thirdweb/engine:latest-{0}', matrix.platform == 'linux/amd64' && 'amd64' || 'arm64') || '' }}
52
- outputs : type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
53
48
cache-from : type=gha,scope=${{ matrix.platform }}
54
49
cache-to : type=gha,scope=${{ matrix.platform }},mode=max
55
50
build-args : ENGINE_VERSION=${{ github.event.release.tag_name }}
56
51
57
- - name : Export digest
58
- run : |
59
- mkdir -p /tmp/digests
60
- digest="${{ steps.build.outputs.digest }}"
61
- touch "/tmp/digests/${digest#sha256:}"
62
-
63
- - name : Upload digest
64
- uses : actions/upload-artifact@v4
65
- with :
66
- name : digests-${{ env.PLATFORM_PAIR }}
67
- path : /tmp/digests/*
68
- if-no-files-found : error
69
- retention-days : 1
70
-
71
52
merge-manifests :
72
53
needs : build
73
54
runs-on : ubuntu-latest
74
55
env :
75
56
LATEST_TAG : ${{ github.event.release.target_commitish == 'main' && 'thirdweb/engine:latest' || '' }}
76
57
steps :
77
- - name : Download digests
78
- uses : actions/download-artifact@v4
79
- with :
80
- path : /tmp/digests
81
- pattern : digests-*
82
- merge-multiple : true
83
-
84
- - name : Set up Docker Buildx
85
- uses : docker/setup-buildx-action@v3
86
-
87
58
- name : Login to DockerHub
88
59
uses : docker/login-action@v3
89
60
with :
90
61
username : ${{ secrets.DOCKER_USERNAME }}
91
62
password : ${{ secrets.DOCKER_PASSWORD }}
92
63
93
- - name : Create and Push Multi-arch Manifest (release tag)
94
- working-directory : /tmp/digests
64
+ - name : Create and Push Multi-arch Manifest (release tag)
95
65
run : |
96
- docker buildx imagetools create -t ${{ env.REGISTRY_IMAGE }}:${{ github.event.release.tag_name }} \
97
- $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
66
+ docker manifest create ${{ env.REGISTRY_IMAGE }}:${{ github.event.release.tag_name }} \
67
+ ${{ env.REGISTRY_IMAGE }}:${{ github.event.release.tag_name }}-amd64 \
68
+ ${{ env.REGISTRY_IMAGE }}:${{ github.event.release.tag_name }}-arm64
69
+ docker manifest push ${{ env.REGISTRY_IMAGE }}:${{ github.event.release.tag_name }}
98
70
99
- - name : Create and Push Multi-arch Manifest (latest tag) (if applicable)
100
- if : ${{ env.LATEST_TAG != '' }}
101
- run : |
102
- docker buildx imagetools create -t ${{ env.REGISTRY_IMAGE }}:latest \
103
- ${{ env.REGISTRY_IMAGE }}@sha256:${{ steps.build.outputs.digest }}
104
71
105
- - name : Inspect image
72
+ - name : Create and Push Multi-arch Manifest (latest tag) (if applicable)
73
+ if : ${{ env.LATEST_TAG != '' }}
106
74
run : |
107
- docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ github.event.release.tag_name }}
75
+ docker manifest create ${{ env.REGISTRY_IMAGE }}:latest \
76
+ ${{ env.REGISTRY_IMAGE }}:latest-arm64 \
77
+ ${{ env.REGISTRY_IMAGE }}:latest-amd64
78
+ docker manifest push ${{ env.REGISTRY_IMAGE }}:latest
0 commit comments