rake-compiler-dock 1.10.0 → 1.11.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,121 @@
1
+ <%= "# This file is generated. Please edit publish-images.yml.erb instead!" %>
2
+
3
+ <% if release %>
4
+ name: Release docker images to GHCR
5
+ #
6
+ # This workflow assumes the maintainer has chosen the appropriate tag in the workflow dispatch UI.
7
+ #
8
+ on:
9
+ workflow_dispatch:
10
+ inputs:
11
+ tag:
12
+ description: "Tag name to release"
13
+ required: true
14
+
15
+ <% else %>
16
+ name: Weekly publish docker images to GHCR
17
+ on:
18
+ workflow_dispatch:
19
+ schedule:
20
+ - cron: "0 3 * * 3" # At 03:00 on Wednesday # https://crontab.guru/#0_3_*_*_3
21
+ <% end %>
22
+
23
+ concurrency:
24
+ group: "${{github.workflow}}-${{github.ref}}"
25
+ cancel-in-progress: true
26
+
27
+ jobs:
28
+ <% parallel_docker_build.tree_deps.to_a.flatten.uniq.each do |tree_dep|
29
+ dockerfile = parallel_docker_build.final_deps.invert[tree_dep]
30
+ job = dockerfile ? dockerfile[/[-\w]+$/] : tree_dep
31
+ %>
32
+ <%= job %>:
33
+ name: "build <%= job %> ${{ matrix.os }}"
34
+ <%= need = parallel_docker_build.tree_deps[tree_dep]; "needs: #{need}" if need %>
35
+ strategy:
36
+ fail-fast: false
37
+ matrix:
38
+ os:
39
+ - ubuntu-latest
40
+ - ubuntu-24.04-arm
41
+ runs-on: ${{ matrix.os }}
42
+ steps:
43
+ - uses: actions/checkout@v4
44
+ <% if release %>
45
+ with:
46
+ ref: ${{ inputs.tag }}
47
+ <% end %>
48
+ - uses: ruby/setup-ruby@v1
49
+ with:
50
+ ruby-version: "3.4"
51
+ bundler-cache: true
52
+
53
+ - name: Fetch docker buildx layer cache
54
+ uses: actions/cache@v4
55
+ with:
56
+ path: tmp/build-cache-${{ runner.arch }}
57
+ key: ${{ runner.os }}-on-${{ runner.arch }}-<%= job %>-${{ github.sha }}
58
+ restore-keys: |
59
+ ${{ runner.os }}-on-${{ runner.arch }}-<%= job %>
60
+ ${{ runner.os }}-on-${{ runner.arch }}-<%= need %>
61
+ enableCrossOsArchive: true
62
+ - name: Build the image layers <%= job %> on ${{ runner.arch }}
63
+ env:
64
+ RCD_TASK_DEPENDENCIES: "false"
65
+ run: |
66
+ # Change docker to a cache-able driver
67
+ docker buildx create --driver docker-container --use
68
+ bundle exec rake build:<%= tree_dep %> RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new"
69
+ - name: Update and prune docker buildx layer cache
70
+ run: |
71
+ rm -rf tmp/build-cache-${{ runner.arch }}
72
+ mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }}
73
+ <% end %>
74
+
75
+ push:
76
+ name: push
77
+ needs: [<%= parallel_docker_build.final_deps.keys.map{|a| a[/[-\w]+$/] }.join(",") %>]
78
+ strategy:
79
+ fail-fast: false
80
+ matrix:
81
+ platform:
82
+ <% parallel_docker_build.final_deps.each do |dockerfile, _| %>
83
+ - <%= dockerfile[/[-\w]+$/] %>
84
+ <% end %>
85
+ runs-on: ubuntu-24.04-arm
86
+ steps:
87
+ - uses: actions/checkout@v4
88
+
89
+ - name: Use X64 cache from tree pipeline of ${{ matrix.platform }}
90
+ uses: actions/cache/restore@v4
91
+ with:
92
+ path: tmp/build-cache-X64
93
+ key: ${{ runner.os }}-on-X64-${{ matrix.platform }}-${{ github.sha }}
94
+ restore-keys: ${{ runner.os }}-on-X64-${{ matrix.platform }}
95
+ enableCrossOsArchive: true
96
+ - name: Use ARM64 cache from tree pipeline of ${{ matrix.platform }}
97
+ uses: actions/cache/restore@v4
98
+ with:
99
+ path: tmp/build-cache-ARM64
100
+ key: ${{ runner.os }}-on-ARM64-${{ matrix.platform }}-${{ github.sha }}
101
+ restore-keys: ${{ runner.os }}-on-ARM64-${{ matrix.platform }}
102
+ enableCrossOsArchive: true
103
+ fail-on-cache-miss: true
104
+
105
+ - uses: ruby/setup-ruby@v1
106
+ with:
107
+ ruby-version: "3.4"
108
+ bundler-cache: true
109
+ - uses: docker/login-action@v3
110
+ with:
111
+ registry: ghcr.io
112
+ username: ${{github.actor}}
113
+ password: ${{secrets.GITHUB_TOKEN}}
114
+ - name: Use cache and push docker image
115
+ env:
116
+ RCD_IMAGE_VERSION: snapshot
117
+ RCD_DOCKER_BUILD: docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-X64 --cache-from=type=local,compression=zstd,src=tmp/build-cache-ARM64
118
+ RCD_TASK_DEPENDENCIES: "false"
119
+ run: |
120
+ docker buildx create --driver docker-container --use
121
+ bundle exec rake release:${{ matrix.platform }}