@@ -31,52 +31,45 @@ 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+ - name : Use ARM64 cache from primary pipeline
41+ uses : actions/cache/restore@v4
42+ with :
43+ path : tmp/build-cache-ARM64
44+ key : ${{ runner.os }}-on-ARM64-${{ matrix.platform }}-buildx-${{ github.sha }}
45+ restore-keys : ${{ runner.os }}-on-ARM64-${{ matrix.platform }}-buildx
46+ fail-on-cache-miss : true
4147 - uses : ruby/setup-ruby@v1
4248 with :
4349 ruby-version : " 3.3"
4450 bundler-cache : true
51+ - uses : docker/login-action@v3
52+ with :
53+ registry : ghcr.io
54+ username : ${{github.actor}}
55+ password : ${{secrets.GITHUB_TOKEN}}
4556 - name : Generate docker image names
4657 id : rcd_config
4758 run : |
4859 bundle exec ruby -e ' \
4960 require "rake_compiler_dock"; \
50- print "image_name= "; \
61+ print "image_name_opt=-t "; \
5162 puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}})); \
52- print "snapshot_name= "; \
63+ print "snapshot_name_opt=-t "; \
5364 puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}}), :version => %q(snapshot)); \
5465 if %q(${{matrix.platform}}).end_with?("-gnu"); \
55- print "generic_linux_snapshot_name= "; \
66+ print "generic_linux_snapshot_name_opt=-t "; \
5667 puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}}), :version => %q(snapshot)).chomp("-gnu"); \
5768 end \
5869 ' | tee -a $GITHUB_OUTPUT
5970 - name : Build docker image
6071 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
72+ 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}}
6273 run : |
6374 docker buildx create --driver docker-container --use
64- bundle exec rake build:x86:${{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}}
75+ bundle exec rake release:${{matrix.platform}}
0 commit comments