Skip to content

Commit 0d31e59

Browse files
committed
ci: pipeline to publish MRI image snapshots
1 parent 358b63e commit 0d31e59

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

.github/workflows/publish-images.yml

+48-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,52 @@ on:
77

88
jobs:
99
build:
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
platform:
14+
- x86-mingw32
15+
- x64-mingw-ucrt
16+
- x64-mingw32
17+
- x86-linux
18+
- x86_64-linux
19+
- x86_64-darwin
20+
- arm64-darwin
21+
- arm-linux
22+
- aarch64-linux
23+
# - jruby
24+
runs-on: ubuntu-latest
1025
steps:
11-
- run: echo "this is a stub pipeline so that I can ship a working version in #84"
26+
- uses: actions/checkout@v3
27+
- name: Cache Docker layers
28+
uses: actions/cache@v3
29+
with:
30+
path: tmp/build-cache
31+
key: ${{runner.os}}-${{matrix.platform}}-buildx-${{github.sha}}
32+
restore-keys: ${{runner.os}}-${{matrix.platform}}-buildx
33+
- uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: "3.0"
36+
bundler-cache: true
37+
- id: rcd_image_version
38+
run: bundle exec ruby -e 'require "rake_compiler_dock"; puts "rcd_image_version=#{RakeCompilerDock::IMAGE_VERSION}"' >> $GITHUB_OUTPUT
39+
- name: Build docker image
40+
env:
41+
DOCKERHUB_USER: rake-compiler
42+
RCD_DOCKER_BUILD: docker buildx build --cache-from=type=local,src=tmp/build-cache --cache-to=type=local,dest=tmp/build-cache-new --load
43+
run: |
44+
docker buildx create --driver docker-container --use
45+
bundle exec rake build:${{matrix.platform}}
46+
- name: Move build cache and remove outdated layers
47+
run: |
48+
rm -rf tmp/build-cache
49+
mv tmp/build-cache-new tmp/build-cache
50+
- uses: docker/login-action@v2
51+
with:
52+
registry: ghcr.io
53+
username: ${{github.actor}}
54+
password: ${{secrets.GITHUB_TOKEN}}
55+
- run: |
56+
docker images
57+
docker tag rake-compiler/rake-compiler-dock-mri-${{matrix.platform}}:${{steps.rcd_image_version.outputs.rcd_image_version}} ghcr.io/rake-compiler/rake-compiler-dock-snapshot:mri-${{matrix.platform}}
58+
docker push ghcr.io/rake-compiler/rake-compiler-dock-snapshot:mri-${{matrix.platform}}

0 commit comments

Comments
 (0)