36
36
default : false
37
37
38
38
jobs :
39
- build-image-amd64 :
40
- name : Build and publish skupper-router amd64 image
39
+ build-multiarch-image :
40
+ name : Build and publish multiarch skupper-router image
41
41
runs-on : ubuntu-latest
42
42
steps :
43
43
- run : |
51
51
fi
52
52
done
53
53
env:
54
- CONTAINER_TAG: '${{github.event.inputs.containerTag}}'
54
+ CONTAINER_TAG: '${{github.event.inputs.containerTag}}'
55
+
56
+ - name : Set up QEMU
57
+ uses : docker/setup-qemu-action@v2
58
+
59
+ - name : Set up Buildx
60
+ uses : docker/setup-buildx-action@v2
61
+
55
62
- uses : actions/checkout@v4
56
- - run : |
63
+ - name : Build and Push Multi-Arch Image
64
+ run : |
57
65
# build, run tests and if all worked publish a custom image
58
66
export PROJECT_TAG="${CONTAINER_TAG}"
59
67
# The version of skupper-router should be the same as the version of the image.
@@ -73,107 +81,11 @@ jobs:
73
81
else
74
82
echo 'image-manual.yml(job:build-manual-amd64) not setting PUSH_LATEST, will not push :latest tag'
75
83
fi
76
- export PLATFORM=amd64
77
- ./.github/scripts/image.sh
78
- env:
79
- CONTAINER_USER: '${{ secrets.DOCKER_USER }}'
80
- CONTAINER_PASSWORD: '${{ secrets.DOCKER_PASSWORD }}'
81
- PROTON_SOURCE_URL: '${{github.event.inputs.protonSourceUrl}}'
82
- CONTAINER_TAG: '${{github.event.inputs.containerTag}}'
83
-
84
- build-image-arm64 :
85
- name : Build and publish skupper-router arm64 image
86
- runs-on : ubuntu-24.04-arm
87
- steps :
88
- - run : |
89
- # validate CONTAINER_TAG
90
- [[ ! "${CONTAINER_TAG}" =~ ^[a-z0-9][a-z0-9.-]+[a-z0-9]$ ]] && echo "invalid tag - it must begin and end with letter or digit and contains - and ." && exit 1
91
- protected=(latest nightly master)
92
- for ptag in ${protected[@]}; do
93
- if [[ "${ptag}" = "${CONTAINER_TAG}" ]]; then
94
- echo "${ptag} cannot be used (protected tag)"
95
- exit 1
96
- fi
97
- done
98
- env:
99
- CONTAINER_TAG: '${{github.event.inputs.containerTag}}'
100
- - uses : actions/checkout@v4
101
- - name : Install podman
102
- run : |
103
- sudo apt-get update -qq
104
- sudo apt-get -qq -y install podman
105
- podman version
106
- # Starting systemd user service
107
- systemctl --user start podman.socket
108
- echo "PODMAN_SOCK=/run/user/${UID}/podman/podman.sock" >> $GITHUB_ENV
109
- echo "DOCKER_HOST=unix:///run/user/${UID}/podman/podman.sock" >> $GITHUB_ENV
110
- - run : |
111
- export PROJECT_TAG="${CONTAINER_TAG}"
112
- # The version of skupper-router should be the same as the version of the image.
113
- export VERSION="${CONTAINER_TAG}"
114
-
115
- if [ "${CONTAINER_TAG}" != "main" ]; then
116
- export BUILD_NUMBER=$((`curl -s https://quay.io/api/v1/repository/skupper/skupper-router/tag/?filter_tag_name=like:${VERSION} | jq '.tags[] | select(has("end_ts") | not) | .name' | grep -E "\"${VERSION}-[0-9]+\"" | wc -l || echo 0` + 1))
117
- # Only accepts tag if build_number is higher than one
118
- # Verify if build number is unique, otherwise fail
119
- [[ ${BUILD_NUMBER} -eq 1 ]] && { echo "The provided tag (${VERSION}) does not refer to a released image. You must provide a tag that has already been released."; exit 1; }
120
- else
121
- echo "CONTAINER_TAG is main"
122
- fi
123
-
124
- CAN_PUSH_LATEST='${{github.event.inputs.canPushLatestTag}}'
125
- if [ "${CAN_PUSH_LATEST}" == "true" ]; then
126
- echo 'image-manual.yml(job:build-image-arm64) setting PUSH_LATEST=true, will push :latest tag'
127
- export PUSH_LATEST=true
128
- else
129
- echo 'image-manual.yml(job:build-image-arm64) not setting PUSH_LATEST, will not push :latest tag'
130
- fi
131
- export PLATFORM=arm64
84
+
132
85
./.github/scripts/image.sh
133
86
env :
134
87
CONTAINER_USER : ' ${{ secrets.DOCKER_USER }}'
135
88
CONTAINER_PASSWORD : ' ${{ secrets.DOCKER_PASSWORD }}'
136
89
PROTON_SOURCE_URL : ' ${{github.event.inputs.protonSourceUrl}}'
137
90
CONTAINER_TAG : ' ${{github.event.inputs.containerTag}}'
138
91
139
- # This job pulls the images produced by the build-image-amd64 and build-image-arm64 jobs
140
- create-manifest :
141
- needs : [build-image-amd64, build-image-arm64]
142
- name : Pull skupper-router amd64 and arm64 images and create/push manifest
143
- runs-on : ubuntu-latest
144
- steps :
145
- - uses : actions/checkout@v4
146
- - name : Install podman
147
- run : |
148
- sudo apt-get update -qq
149
- sudo apt-get -qq -y install podman
150
- podman version
151
- # Starting systemd user service
152
- systemctl --user start podman.socket
153
- echo "PODMAN_SOCK=/run/user/${UID}/podman/podman.sock" >> $GITHUB_ENV
154
- echo "DOCKER_HOST=unix:///run/user/${UID}/podman/podman.sock" >> $GITHUB_ENV
155
- - name : Pull skupper-router amd64 and arm64 images and create/push manifest
156
- run : |
157
- export VERSION="${CONTAINER_TAG}"
158
- if [ "${CONTAINER_TAG}" != "main" ]; then
159
- export BUILD_NUMBER=$((`curl -s https://quay.io/api/v1/repository/skupper/skupper-router/tag/?filter_tag_name=like:${VERSION} | jq '.tags[] | select(has("end_ts") | not) | .name' | grep -E "\"${VERSION}-[0-9]+\"" | wc -l || echo 0` + 1))
160
- echo "BUILD_NUMER(create-manifest)=${BUILD_NUMBER}"
161
- # Only accepts tag if build_number is higher than one
162
- # Verify if build number is unique, otherwise fail
163
- [[ ${BUILD_NUMBER} -eq 1 ]] && { echo "The provided tag (${VERSION}) does not refer to a released image. You must provide a tag that has already been released."; exit 1; }
164
- else
165
- echo "CONTAINER_TAG is main"
166
- fi
167
- export PROJECT_TAG="${CONTAINER_TAG}"
168
- CAN_PUSH_LATEST='${{github.event.inputs.canPushLatestTag}}'
169
- if [ "${CAN_PUSH_LATEST}" == "true" ]; then
170
- echo 'image-manual.yml(job:pull-images) setting PUSH_LATEST=true, will push :latest tag'
171
- export PUSH_LATEST=true
172
- else
173
- echo 'image-manual.yml(job:pull-images) not setting PUSH_LATEST, will not push :latest tag'
174
- fi
175
- ./.github/scripts/manifest.sh
176
- env :
177
- CONTAINER_USER : ' ${{ secrets.DOCKER_USER }}'
178
- CONTAINER_PASSWORD : ' ${{ secrets.DOCKER_PASSWORD }}'
179
- CONTAINER_TAG : ' ${{github.event.inputs.containerTag}}'
0 commit comments