@@ -31,52 +31,47 @@ jobs:
3131 runs-on : ubuntu-latest
3232 steps :
3333 - uses : actions/checkout@v4
34- - name : Use cache from primary pipeline
35- uses : actions/cache@v4
34+ - name : Use X64 cache from primary pipeline
35+ uses : actions/cache/restore @v4
3636 with :
37- path : tmp/build-cache
38- key : ${{runner.os}}-${{matrix.platform}}-buildx-${{github.sha}}
39- restore-keys : |
40- ${{runner.os}}-${{matrix.platform}}-buildx
37+ path : tmp/build-cache-X64
38+ key : ${{ runner.os }}-on-X64-${{ matrix.platform }}-buildx-${{ github.sha }}
39+ restore-keys : ${{ runner.os }}-on-X64-${{ matrix.platform }}-buildx
40+ enableCrossOsArchive : true
41+ - name : Use ARM64 cache from primary pipeline
42+ uses : actions/cache/restore@v4
43+ with :
44+ path : tmp/build-cache-ARM64
45+ key : ${{ runner.os }}-on-ARM64-${{ matrix.platform }}-buildx-${{ github.sha }}
46+ restore-keys : ${{ runner.os }}-on-ARM64-${{ matrix.platform }}-buildx
47+ enableCrossOsArchive : true
48+ fail-on-cache-miss : true
4149 - uses : ruby/setup-ruby@v1
4250 with :
4351 ruby-version : " 3.3"
4452 bundler-cache : true
53+ - uses : docker/login-action@v3
54+ with :
55+ registry : ghcr.io
56+ username : ${{github.actor}}
57+ password : ${{secrets.GITHUB_TOKEN}}
4558 - name : Generate docker image names
4659 id : rcd_config
4760 run : |
4861 bundle exec ruby -e ' \
4962 require "rake_compiler_dock"; \
50- print "image_name= "; \
63+ print "image_name_opt=-t "; \
5164 puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}})); \
52- print "snapshot_name= "; \
65+ print "snapshot_name_opt=-t "; \
5366 puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}}), :version => %q(snapshot)); \
5467 if %q(${{matrix.platform}}).end_with?("-gnu"); \
55- print "generic_linux_snapshot_name= "; \
68+ print "generic_linux_snapshot_name_opt=-t "; \
5669 puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}}), :version => %q(snapshot)).chomp("-gnu"); \
5770 end \
5871 ' | tee -a $GITHUB_OUTPUT
5972 - name : Build docker image
6073 env :
61- RCD_DOCKER_BUILD : docker buildx build --cache-from=type=local,src=tmp/build-cache --cache-to=type=local,dest=tmp/build-cache-new --load
74+ RCD_DOCKER_BUILD : docker buildx build --cache-from=type=local,src=tmp/build-cache-X64 --cache-from=type=local,src=tmp/build-cache-ARM64 --cache- to=type=local,dest=tmp/build-cache-new ${{steps.rcd_config.outputs.snapshot_name_opt}} ${{steps.rcd_config.outputs.generic_linux_snapshot_name_opt}}
6275 run : |
6376 docker buildx create --driver docker-container --use
64- bundle exec rake build:${{matrix.platform}}
65- # move build cache and remove outdated layers
66- rm -rf tmp/build-cache
67- mv tmp/build-cache-new tmp/build-cache
68- - uses : docker/login-action@v3
69- with :
70- registry : ghcr.io
71- username : ${{github.actor}}
72- password : ${{secrets.GITHUB_TOKEN}}
73- - name : Push the docker image
74- run : |
75- docker images
76- docker tag ${{steps.rcd_config.outputs.image_name}} ${{steps.rcd_config.outputs.snapshot_name}}
77- docker push ${{steps.rcd_config.outputs.snapshot_name}}
78- - name : Push a generic linux image
79- if : ${{ steps.rcd_config.outputs.generic_linux_snapshot_name }}
80- run : |
81- docker tag ${{steps.rcd_config.outputs.image_name}} ${{steps.rcd_config.outputs.generic_linux_snapshot_name}}
82- docker push ${{steps.rcd_config.outputs.generic_linux_snapshot_name}}
77+ bundle exec rake release:${{matrix.platform}}
0 commit comments