@@ -3,6 +3,30 @@ name: Build rig containers for new release
3
3
on :
4
4
workflow_dispatch :
5
5
inputs :
6
+ amd64 :
7
+ description : ' Build x86_64 containers'
8
+ required : true
9
+ type : choice
10
+ options :
11
+ - ' yes'
12
+ - ' no'
13
+ default : ' yes'
14
+ arm64 :
15
+ description : ' Build aarch64 containers'
16
+ required : true
17
+ type : choice
18
+ options :
19
+ - ' yes'
20
+ - ' no'
21
+ default : ' yes'
22
+ manifest :
23
+ description : ' Build multi-arch manifest'
24
+ required : true
25
+ type : choice
26
+ options :
27
+ - ' yes'
28
+ - ' no'
29
+ default : ' yes'
6
30
inpconts :
7
31
description : |
8
32
Containers, comma separated list or 'all'.
19
43
setup-matrix :
20
44
runs-on : ubuntu-latest
21
45
outputs :
22
- containers : ${{steps.setup-matrix.outputs.containers}}
46
+ containers : ${{ steps.setup-matrix.outputs.containers }}
23
47
24
48
steps :
25
49
- uses : actions/checkout@v4
@@ -31,36 +55,55 @@ jobs:
31
55
32
56
# ------------------------------------------------------------------------
33
57
34
- containers :
58
+ amd64 :
59
+ if : ${{ inputs.amd64 == 'yes' }}
35
60
needs : setup-matrix
36
61
strategy :
37
62
fail-fast : false
38
63
matrix :
39
64
config : ${{ fromJson(needs.setup-matrix.outputs.containers) }}
40
- runs-on : ubuntu-latest
41
- name : ${{ matrix.config.name }}
65
+ uses : ./.github/workflows/conts-workflow.yml
66
+ with :
67
+ config : " ${{ toJSON(matrix.config) }}"
68
+ platform : amd64
69
+ runs-on : ubuntu-latest
70
+ secrets : inherit
42
71
43
- steps :
44
- - uses : actions/checkout@v4
72
+ arm64 :
73
+ if : ${{ inputs.arm64 == 'yes' }}
74
+ needs : setup-matrix
75
+ strategy :
76
+ fail-fast : false
77
+ matrix :
78
+ config : ${{ fromJson(needs.setup-matrix.outputs.containers) }}
79
+ uses : ./.github/workflows/conts-workflow.yml
80
+ with :
81
+ config : " ${{ toJSON(matrix.config) }}"
82
+ platform : arm64
83
+ runs-on : ubuntu-24.04-arm
84
+ secrets : inherit
45
85
86
+ manifest :
87
+ if : ${{ inputs.manifest == 'yes' && always() }}
88
+ needs : [ setup-matrix, amd64, arm64 ]
89
+ runs-on : ubuntu-latest
90
+ strategy :
91
+ fail-fast : false
92
+ matrix :
93
+ config : ${{ fromJson(needs.setup-matrix.outputs.containers) }}
94
+ steps :
46
95
- name : Login to GitHub Container Registry
47
96
uses : docker/login-action@v3
48
97
with :
49
98
registry : ghcr.io
50
99
username : ${{ github.repository_owner }}
51
100
password : ${{ secrets.GITHUB_TOKEN }}
52
-
53
101
- name : Set up Docker Buildx
54
102
uses : docker/setup-buildx-action@v3
55
-
56
- - name : Build
57
- uses : docker/build-push-action@v5
58
- with :
59
- platforms : linux/amd64,linux/arm64
60
- provenance : false
61
- context : containers/${{ matrix.config.dir }}
62
- file : ${{ matrix.config.file }}
63
- build-args : " ${{ join(matrix.config.args, '\n ') }}"
64
- push : true
65
- outputs :
66
- tags : " ${{ join(matrix.config.tags, '\n ') }}"
103
+ - run : |
104
+ for tag in ${{ join(matrix.config.tags, ' ') }}; do
105
+ docker buildx imagetools create -t ${tag} \
106
+ ghcr.io/r-lib/rig/${{ matrix.config.name }}-amd64:latest \
107
+ ghcr.io/r-lib/rig/${{ matrix.config.name }}-arm64:latest;
108
+ done
109
+ shell: bash
0 commit comments