@@ -92,26 +92,13 @@ jobs:
92
92
tags : localhost:5000/${{ github.repository_owner }}/golang-with-libgit2-all:latest
93
93
cache-from : type=local,src=/tmp/.buildx-cache
94
94
cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max
95
- - name : Build candidate image - libgit2 only
96
- id : build_candidate_libgti2_only
97
- uses : docker/build-push-action@v3
98
- with :
99
- context : .
100
- file : Dockerfile.libgit2-only
101
- platforms : ${{ env.PLATFORMS }}
102
- push : true
103
- tags : localhost:5000/${{ github.repository_owner }}/golang-with-libgit2-only:latest
104
- cache-from : type=local,src=/tmp/.buildx-cache
105
- cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max
106
95
- name : Inspect candidate images
107
96
run : |
108
97
docker buildx imagetools inspect localhost:5000/${{ github.repository_owner }}/golang-with-libgit2-all:latest
109
- docker buildx imagetools inspect localhost:5000/${{ github.repository_owner }}/golang-with-libgit2-only:latest
110
98
- name : Test candidate images
111
99
id : test_candidate
112
100
run : |
113
101
IMG=localhost:5000/${{ github.repository_owner }}/golang-with-libgit2-all make test
114
- IMG=localhost:5000/${{ github.repository_owner }}/golang-with-libgit2-only LIBGIT2_ONLY=true make test
115
102
- # Temp fix
116
103
# https://github.com/docker/build-push-action/issues/252
117
104
# https://github.com/moby/buildkit/issues/1896
@@ -134,9 +121,7 @@ jobs:
134
121
images : |
135
122
ghcr.io/${{ github.repository_owner }}/golang-with-libgit2-all
136
123
tags : |
137
- type=schedule
138
- type=ref,event=branch
139
- type=ref,event=tag
124
+ type=semver,pattern=v{{version}}
140
125
type=sha
141
126
type=sha,format=long
142
127
- name : Release candidate image - golang-with-libgit2-all
@@ -162,6 +147,85 @@ jobs:
162
147
cosign sign $image
163
148
done
164
149
150
+ build-libgit2-only :
151
+ runs-on : ubuntu-latest
152
+ env :
153
+ PLATFORMS : linux/amd64,linux/arm/v7,linux/arm64
154
+ services :
155
+ registry :
156
+ image : registry:2
157
+ ports :
158
+ - 5000:5000
159
+ steps :
160
+ - name : Checkout
161
+ uses : actions/checkout@v3
162
+ - name : Unshallow
163
+ run : git fetch --prune --unshallow
164
+ - name : Setup Cosign
165
+ uses : sigstore/cosign-installer@main
166
+ - name : Set up QEMU
167
+ id : qemu
168
+ uses : docker/setup-qemu-action@v2
169
+ with :
170
+ image : tonistiigi/binfmt:latest
171
+ platforms : ${{ env.PLATFORMS }}
172
+ - name : Set up Docker Buildx
173
+ id : buildx
174
+ uses : docker/setup-buildx-action@v2
175
+ with :
176
+ config-inline : |
177
+ [worker.oci]
178
+ max-parallelism = 4
179
+ driver-opts : network=host
180
+ - name : Inspect builder
181
+ run : |
182
+ echo "Name: ${{ steps.buildx.outputs.name }}"
183
+ echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
184
+ echo "Status: ${{ steps.buildx.outputs.status }}"
185
+ echo "Flags: ${{ steps.buildx.outputs.flags }}"
186
+ echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
187
+ - name : Cache Docker layers
188
+ uses : actions/cache@v3
189
+ id : cache
190
+ with :
191
+ path : /tmp/.buildx-cache
192
+ key : ${{ runner.os }}-buildx-ghcache-${{ github.sha }}
193
+ restore-keys : |
194
+ ${{ runner.os }}-buildx-ghcache-
195
+ - run : cat ./hack/static.sh
196
+ - name : Build candidate image - libgit2 only
197
+ id : build_candidate_libgti2_only
198
+ uses : docker/build-push-action@v3
199
+ with :
200
+ context : .
201
+ file : Dockerfile.libgit2-only
202
+ platforms : ${{ env.PLATFORMS }}
203
+ push : true
204
+ tags : localhost:5000/${{ github.repository_owner }}/golang-with-libgit2-only:latest
205
+ cache-from : type=local,src=/tmp/.buildx-cache
206
+ cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max
207
+ - name : Inspect candidate images
208
+ run : |
209
+ docker buildx imagetools inspect localhost:5000/${{ github.repository_owner }}/golang-with-libgit2-only:latest
210
+ - name : Test candidate images
211
+ id : test_candidate
212
+ run : |
213
+ IMG=localhost:5000/${{ github.repository_owner }}/golang-with-libgit2-only LIBGIT2_ONLY=true make test
214
+ - # Temp fix
215
+ # https://github.com/docker/build-push-action/issues/252
216
+ # https://github.com/moby/buildkit/issues/1896
217
+ name : Move cache
218
+ run : |
219
+ rm -rf /tmp/.buildx-cache
220
+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
221
+ - name : Login to GHCR
222
+ if : github.event_name != 'pull_request'
223
+ uses : docker/login-action@v2
224
+ with :
225
+ registry : ghcr.io
226
+ username : ${{ github.repository_owner }}
227
+ password : ${{ secrets.GITHUB_TOKEN }}
228
+
165
229
- name : Compose release candidate metadata - golang-with-libgit2-only
166
230
id : meta_libgit2_only
167
231
uses : docker/metadata-action@v3
@@ -170,9 +234,7 @@ jobs:
170
234
images : |
171
235
ghcr.io/${{ github.repository_owner }}/golang-with-libgit2-only
172
236
tags : |
173
- type=schedule
174
- type=ref,event=branch
175
- type=ref,event=tag
237
+ type=semver,pattern=v{{version}}
176
238
type=sha
177
239
type=sha,format=long
178
240
- name : Release candidate image - golang-with-libgit2-only
0 commit comments