@@ -16,7 +16,7 @@ concurrency:
1616
1717env :
1818 sha : ${{ github.event.pull_request.head.sha || github.sha }}
19- image : ${{ format('{0}/{1}', secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io', github.repository) }}
19+ image_repo : ${{ format('{0}/{1}', secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io', github.repository) }}
2020 # Cache ID is a value inserted into cache keys. Whenever changing the build
2121 # in a way that needs to use entirely new fresh builds, increment the number
2222 # by one so that all the keys become new.
2727
2828jobs :
2929
30- # complete:
31- # if: always()
32- # needs: [build, test]
33- # runs-on: ubuntu-latest
34- # steps:
35- # - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
36- # run: exit 1
30+ complete :
31+ if : always()
32+ needs : [setup, load, build, test, push ]
33+ runs-on : ubuntu-latest
34+ steps :
35+ - if : contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
36+ run : exit 1
3737
3838 setup :
3939 runs-on : ubuntu-latest
@@ -153,7 +153,7 @@ jobs:
153153 dep : ${{ fromJSON(needs.prepare.outputs.deps-to-build) }}
154154 fail-fast : false
155155 name : build ${{ matrix.dep.name }} ${{ matrix.dep.repo }} ${{ matrix.dep.ref }} ${{ matrix.dep.arch }} ${{ matrix.dep.options && toJSON(matrix.dep.options) }}
156- runs-on : ${{ matrix.dep.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
156+ runs-on : ${{ matrix.dep.name == 'core' && (matrix.dep. arch == 'arm64' && 'ubuntu-jammy-16-cores-amd64' || 'ubuntu-latest-16-cores') || (matrix.dep.arch == 'arm64' && 'ubuntu- 24.04-arm' || 'ubuntu-latest') }}
157157 env :
158158 image_filename : image-${{ matrix.dep.name }}-${{ matrix.dep.id }}-${{ matrix.dep.arch }}.tar
159159 steps :
@@ -215,9 +215,9 @@ jobs:
215215 < "${image/%.tar/.json}" jq
216216 docker load -i $image
217217 done
218- - name : Create Full Tag Name
218+ - name : Create Tag
219219 id : tag
220- run : echo "tag=${{ enV.image }}${{ needs.setup.outputs.tag-prefix }}${{ matrix.image.tag }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
220+ run : echo "tag=${{ needs.setup.outputs.tag-prefix }}- ${{ matrix.image.tag }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
221221 - name : Pull Base Image
222222 run : docker pull --platform linux/${{ matrix.arch }} ubuntu:22.04
223223 # Docker buildx cannot be used to build the dev quickstart image because
@@ -231,7 +231,7 @@ jobs:
231231 docker build
232232 --platform linux/${{ matrix.arch }}
233233 -f Dockerfile
234- -t ${{ steps.tag.outputs.tag }}
234+ -t ${{ env.image_repo }}:${{ steps.tag.outputs.tag }}
235235 --label org.opencontainers.image.revision="${{ env.sha }}"
236236 .
237237 --build-arg REVISION="${{ env.sha }}"
@@ -286,33 +286,33 @@ jobs:
286286 df -h
287287 - uses : actions/checkout@v2
288288 with :
289- ref : ${{ inputs .sha }}
289+ ref : ${{ env .sha }}
290290 - name : Download Quickstart Image
291291 uses : actions/download-artifact@v4
292292 with :
293- name : image-quickstart-${{ matrix.tag }}-${{ inputs .arch }}
293+ name : image-quickstart-${{ matrix.tag }}-${{ matrix .arch }}
294294 path : /tmp/
295295 - name : Load Quickstart Image
296296 run : docker load -i /tmp/image
297297 - if : inputs.arch == 'arm64'
298298 uses : docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18
299299 with :
300300 platforms : arm64
301- - name : Create Full Tag Name
301+ - name : Create Tag
302302 id : tag
303- run : echo "tag=${{ env.image }}${{ needs.setup.outputs.tag-prefix }}${{ matrix.tag }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
303+ run : echo "tag=${{ needs.setup.outputs.tag-prefix }}- ${{ matrix.tag }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
304304 - name : Prepare Logs Directory
305305 run : mkdir -p logs
306306 - name : Run Quickstart Image
307307 run : >
308308 docker run
309- --platform linux/${{ inputs .arch }}
309+ --platform linux/${{ matrix .arch }}
310310 -d
311311 -p
312312 "8000:8000"
313313 -p "11626:11626"
314314 --name stellar
315- ${{ steps.tag.outputs.tag }}
315+ ${{ env.image_repo }}:${{ steps.tag.outputs.tag }}
316316 --${{ matrix.network }}
317317 --enable ${{ matrix.core && 'core' }},${{ matrix.rpc && 'rpc' }},${{ matrix.horizon && 'horizon' }}
318318 ${{ matrix.options }}
@@ -377,6 +377,82 @@ jobs:
377377 if : always()
378378 uses : actions/upload-artifact@v4
379379 with :
380- name : logs-${{ inputs .tag }}-${{ inputs .arch }}-test-${{ strategy.job-index }}
380+ name : logs-${{ matrix .tag }}-${{ matrix .arch }}-test-${{ strategy.job-index }}
381381 path : logs
382- retention-days : ${{ env.ARTIFACT_RETENTION_DAYS_FOR_LOGS }}
382+ retention-days : ${{ env.artifact_retention_days_for_logs }}
383+
384+ push :
385+ needs : test
386+ if : always() && !failure() && !cancelled() && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository))
387+ strategy :
388+ matrix :
389+ tag : ${{ fromJSON(needs.setup.outputs.images).*.tag }}
390+ arch : ["amd64", "arm64"]
391+ fail-fast : false
392+ permissions :
393+ packages : write
394+ statuses : write
395+ runs-on : ubuntu-latest
396+ steps :
397+ - uses : actions/checkout@v2
398+ with :
399+ ref : ${{ inputs.sha }}
400+ - name : Create Tag
401+ id : tag
402+ run : echo "tag=${{ needs.setup.outputs.tag-prefix }}-${{ matrix.tag }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
403+ - uses : ./.github/actions/push
404+ with :
405+ head_sha : ${{ env.sha }}
406+ artifact_name : image-quickstart-${{ matrix.tag }}-${{ matrix.arch }}
407+ artifact_image_file : image
408+ arch : ${{ matrix.arch }}
409+ image : ${{ env.image_repo }}:${{ steps.tag.outputs.tag }}
410+ registry : ${{ secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io' }}
411+ username : ${{ secrets.DOCKERHUB_USERNAME || github.actor }}
412+ password : ${{ secrets.DOCKERHUB_TOKEN || github.token }}
413+
414+ manifest :
415+ needs : push
416+ if : github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
417+ strategy :
418+ matrix :
419+ tag : ${{ fromJSON(needs.setup.outputs.images).*.tag }}
420+ fail-fast : false
421+ permissions :
422+ packages : write
423+ statuses : write
424+ runs-on : ubuntu-latest
425+ steps :
426+ - name : Create Tag
427+ id : tag
428+ run : echo "tag=${{ needs.setup.outputs.tag-prefix }}-${{ matrix.tag }}" >> $GITHUB_OUTPUT
429+ run : echo "tag-alias=${{ needs.setup.outputs.tag-alias-prefix }}-${{ matrix.tag }}" >> $GITHUB_OUTPUT
430+ - uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
431+ with :
432+ registry : ${{ env.REGISTRY }}
433+ username : ${{ secrets.DOCKERHUB_USERNAME || github.actor }}
434+ password : ${{ secrets.DOCKERHUB_TOKEN || github.token }}
435+ - run : >
436+ docker manifest create
437+ ${{ env.image_repo }}:${{ steps.tag.outputs.tag }}
438+ ${{ env.image_repo }}:${{ steps.tag.outputs.tag }}-amd64
439+ ${{ env.image_repo }}:${{ steps.tag.outputs.tag }}-arm64
440+ - run : >
441+ docker manifest push
442+ ${{ env.image_repo }}:${{ steps.tag.outputs.tag }}
443+ - run : >
444+ docker buildx imagetools create -t
445+ ${{ env.image_repo }}:${{ steps.tag.outputs.tag-alias }}
446+ ${{ env.image_repo }}:${{ steps.tag.outputs.tag }}
447+ - uses : actions/github-script@v5
448+ with :
449+ script : |
450+ github.rest.repos.createCommitStatus({
451+ owner: context.repo.owner,
452+ repo: context.repo.repo,
453+ sha: '${{ env.HEAD_SHA }}',
454+ state: 'success',
455+ context: `${{ env.IMAGE }}`,
456+ target_url: '${{ env.IMAGE_URL }}',
457+ description: 'Available',
458+ });
0 commit comments