@@ -35,13 +35,27 @@ jobs:
3535 id-token : write
3636 env :
3737 IMAGE_NAME : ${{ needs.image-details.outputs.base-name }}
38- # Cannot reference IMAGE_NAME as it does not exist yet
3938 IMAGE_URL : ${{ needs.image-details.outputs.base-url }}
39+ # Image variant name is drawn from final `--dir` entry in file generation command line
40+ IMAGE_DIR : build/standard
4041
4142 steps :
43+ - name : ' Set up Ruby for generation tool'
44+ uses : ruby/setup-ruby@v1
45+ with :
46+ ruby-version : ' 3.3'
47+ bundler-cache : true
48+
4249 - name : ' Checkout GitHub Action'
4350 uses : actions/checkout@v4
4451
52+ - name : ' Install file generation Ruby dependencies'
53+ run : bundle install
54+
55+ - name : ' Run file generation'
56+ id : file-gen
57+ run : bash build.sh --dir ${{ env.IMAGE_DIR }} --version ${{ github.ref_name }}
58+
4559 - name : ' Set up QEMU'
4660 uses : docker/setup-qemu-action@v3
4761
@@ -61,12 +75,16 @@ jobs:
6175 uses : docker/build-push-action@v6
6276 with :
6377 platforms : linux/amd64,linux/arm64
64- file : build/standard/docker/Dockerfile
78+ context : .
79+ file : ${{ env.IMAGE_DIR }}/docker/Dockerfile
6580 build-args : |
6681 CONTAINER_VERSION=${{ github.ref_name }}
6782 IMAGE_NAME=${{ env.IMAGE_NAME }}
6883 push : ${{ github.event_name != 'pull_request' }}
6984 tags : ${{ env.IMAGE_URL }}:${{ github.ref_name }}, ${{ env.IMAGE_URL }}:latest
85+ # Connect Docker driver to GitHub Action cache service
86+ cache-from : type=gha
87+ cache-to : type=gha,mode=max
7088
7189 madsciencelab-plugins :
7290 runs-on : ubuntu-latest
@@ -77,16 +95,27 @@ jobs:
7795 attestations : write
7896 id-token : write
7997 env :
80- VARIANT : ' plugins'
81- # Cannot reference VARIANT as it does not exist yet
8298 IMAGE_NAME : ${{ needs.image-details.outputs.base-name }}-plugins
83- # Cannot reference IMAGE_NAME as it does not exist yet
8499 IMAGE_URL : ${{ needs.image-details.outputs.base-url }}-plugins
100+ # Image variant name is drawn from final `--dir` entry in file generation command line
101+ IMAGE_DIR : build/plugins
85102
86103 steps :
104+ - name : ' Set up Ruby for generation tool'
105+ uses : ruby/setup-ruby@v1
106+ with :
107+ ruby-version : ' 3.3'
108+ bundler-cache : true
109+
87110 - name : ' Checkout GitHub Action'
88111 uses : actions/checkout@v4
89112
113+ - name : ' Install file generation Ruby dependencies'
114+ run : bundle install
115+
116+ - name : ' Run file generation'
117+ run : bash build.sh --dir build/standard --dir ${{ env.IMAGE_DIR }} --version ${{ github.ref_name }}
118+
90119 - name : ' Set up QEMU'
91120 uses : docker/setup-qemu-action@v3
92121
@@ -105,12 +134,16 @@ jobs:
105134 uses : docker/build-push-action@v6
106135 with :
107136 platforms : linux/amd64,linux/arm64
108- file : build/${{ env.VARIANT }}/docker/Dockerfile
137+ context : .
138+ file : ${{ env.IMAGE_DIR }}/docker/Dockerfile
109139 build-args : |
110140 CONTAINER_VERSION=${{ github.ref_name }}
111141 IMAGE_NAME=${{ env.IMAGE_NAME }}
112142 push : ${{ github.event_name != 'pull_request' }}
113143 tags : ${{ env.IMAGE_URL }}:${{ github.ref_name }}, ${{ env.IMAGE_URL }}:latest
144+ # Connect Docker driver to GitHub Action cache service
145+ cache-from : type=gha
146+ cache-to : type=gha,mode=max
114147
115148 madsciencelab-arm-none-eabi :
116149 runs-on : ubuntu-latest
@@ -121,16 +154,27 @@ jobs:
121154 attestations : write
122155 id-token : write
123156 env :
124- VARIANT : ' arm-none-eabi'
125- # Cannot reference VARIANT as it does not exist yet
126157 IMAGE_NAME : ${{ needs.image-details.outputs.base-name }}-arm-none-eabi
127- # Cannot reference IMAGE_NAME as it does not exist yet
128158 IMAGE_URL : ${{ needs.image-details.outputs.base-url }}-arm-none-eabi
159+ # Image variant name is drawn from final `--dir` entry in file generation command line
160+ IMAGE_DIR : build/arm-none-eabi
129161
130162 steps :
163+ - name : ' Set up Ruby for generation tool'
164+ uses : ruby/setup-ruby@v1
165+ with :
166+ ruby-version : ' 3.3'
167+ bundler-cache : true
168+
131169 - name : ' Checkout GitHub Action'
132170 uses : actions/checkout@v4
133171
172+ - name : ' Install file generation Ruby dependencies'
173+ run : bundle install
174+
175+ - name : ' Run file generation'
176+ run : bash build.sh --dir ${{ env.IMAGE_DIR }} --version ${{ github.ref_name }}
177+
134178 - name : ' Set up QEMU'
135179 uses : docker/setup-qemu-action@v3
136180
@@ -149,12 +193,16 @@ jobs:
149193 uses : docker/build-push-action@v6
150194 with :
151195 platforms : linux/amd64,linux/arm64
152- file : build/${{ env.VARIANT }}/docker/Dockerfile
196+ context : .
197+ file : ${{ env.IMAGE_DIR }}/docker/Dockerfile
153198 build-args : |
154199 CONTAINER_VERSION=${{ github.ref_name }}
155200 IMAGE_NAME=${{ env.IMAGE_NAME }}
156201 push : ${{ github.event_name != 'pull_request' }}
157202 tags : ${{ env.IMAGE_URL }}:${{ github.ref_name }}, ${{ env.IMAGE_URL }}:latest
203+ # Connect Docker driver to GitHub Action cache service
204+ cache-from : type=gha
205+ cache-to : type=gha,mode=max
158206
159207 madsciencelab-arm-none-eabi-plugins :
160208 runs-on : ubuntu-latest
@@ -165,16 +213,27 @@ jobs:
165213 attestations : write
166214 id-token : write
167215 env :
168- VARIANT : ' arm-none-eabi-plugins'
169- # Cannot reference VARIANT as it does not exist yet
170216 IMAGE_NAME : ${{ needs.image-details.outputs.base-name }}-arm-none-eabi-plugins
171- # Cannot reference IMAGE_NAME as it does not exist yet
172217 IMAGE_URL : ${{ needs.image-details.outputs.base-url }}-arm-none-eabi-plugins
218+ # Image variant name is drawn from final `--dir` entry in file generation command line
219+ IMAGE_DIR : build/arm-none-eabi-plugins
173220
174221 steps :
222+ - name : ' Set up Ruby for generation tool'
223+ uses : ruby/setup-ruby@v1
224+ with :
225+ ruby-version : ' 3.3'
226+ bundler-cache : true
227+
175228 - name : ' Checkout GitHub Action'
176229 uses : actions/checkout@v4
177230
231+ - name : ' Install file generation Ruby dependencies'
232+ run : bundle install
233+
234+ - name : ' Run file generation'
235+ run : bash build.sh --dir build/arm-none-eabi --dir build/plugins --dir ${{ env.IMAGE_DIR }} --version ${{ github.ref_name }}
236+
178237 - name : ' Set up QEMU'
179238 uses : docker/setup-qemu-action@v3
180239
@@ -193,10 +252,29 @@ jobs:
193252 uses : docker/build-push-action@v6
194253 with :
195254 platforms : linux/amd64,linux/arm64
196- file : build/${{ env.VARIANT }}/docker/Dockerfile
255+ context : .
256+ file : ${{ env.IMAGE_DIR }}/docker/Dockerfile
197257 build-args : |
198258 CONTAINER_VERSION=${{ github.ref_name }}
199259 IMAGE_NAME=${{ env.IMAGE_NAME }}
200260 push : ${{ github.event_name != 'pull_request' }}
201261 tags : ${{ env.IMAGE_URL }}:${{ github.ref_name }}, ${{ env.IMAGE_URL }}:latest
262+ # Connect Docker driver to GitHub Action cache service
263+ cache-from : type=gha
264+ cache-to : type=gha,mode=max
265+
266+ artifacts-release :
267+ runs-on : ubuntu-latest
268+ needs : [madsciencelab, madsciencelab-plugins, madsciencelab-arm-none-eabi, madsciencelab-arm-none-eabi-plugins]
269+ permissions :
270+ contents : write
271+
272+ steps :
273+ - uses : ncipollo/release-action@v1
274+ with :
275+ # Defaults to using tag name.
276+ # This workflow is only triggered by tags.
277+ prerelease : false
278+ allowUpdates : true
279+ artifacts : " build/*/docker/Dockerfile,build/*/assets/shell/welcome"
202280
0 commit comments