61
61
fedora_version : [40]
62
62
include :
63
63
- fedora_version : 40
64
+ bazzite_version : " v3.6"
64
65
is_latest_version : true
65
66
is_stable_version : true
66
67
kernel_flavor : fsync # must match a kernel_flavor from akmods repo
@@ -133,64 +134,6 @@ jobs:
133
134
- name : Maximize build space
134
135
uses : ublue-os/remove-unwanted-software@v7
135
136
136
- - name : Generate tags
137
- id : generate-tags
138
- shell : bash
139
- run : |
140
- # Generate a timestamp for creating an image version history
141
- TIMESTAMP="$(date +%Y%m%d)"
142
- FEDORA_VERSION="${{ matrix.fedora_version }}"
143
- COMMIT_TAGS=()
144
- BUILD_TAGS=()
145
- # Have tags for tracking builds during pull request
146
- SHA_SHORT="${GITHUB_SHA::7}"
147
- COMMIT_TAGS+=("pr-${{ github.event.pull_request.number }}-${FEDORA_VERSION}")
148
- COMMIT_TAGS+=("${SHA_SHORT}-${FEDORA_VERSION}")
149
- if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
150
- [[ "${{ matrix.is_stable_version }}" == "true" ]]; then
151
- COMMIT_TAGS+=("pr-${{ github.event.pull_request.number }}")
152
- COMMIT_TAGS+=("${SHA_SHORT}")
153
- fi
154
-
155
- if [[ ${{ github.ref_name }} == "unstable" ]]; then
156
- BUILD_TAGS=("${FEDORA_VERSION}-unstable" "${FEDORA_VERSION}-unstable-${TIMESTAMP}")
157
- if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
158
- [[ "${{ matrix.is_stable_version }}" == "true" ]]; then
159
- BUILD_TAGS+=("unstable")
160
- echo "DEFAULT_TAG=unstable" >> $GITHUB_ENV
161
- fi
162
- elif [[ ${{ github.ref_name }} == "testing" ]]; then
163
- BUILD_TAGS=("${FEDORA_VERSION}-testing" "${FEDORA_VERSION}-testing-${TIMESTAMP}")
164
- if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
165
- [[ "${{ matrix.is_stable_version }}" == "true" ]]; then
166
- BUILD_TAGS+=("testing")
167
- echo "DEFAULT_TAG=testing" >> $GITHUB_ENV
168
- fi
169
- else
170
- BUILD_TAGS=("${FEDORA_VERSION}" "${FEDORA_VERSION}-${TIMESTAMP}")
171
- BUILD_TAGS+=("${FEDORA_VERSION}-stable" "${FEDORA_VERSION}-stable-${TIMESTAMP}")
172
- if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
173
- [[ "${{ matrix.is_stable_version }}" == "true" ]]; then
174
- BUILD_TAGS+=("latest" "stable")
175
- echo "DEFAULT_TAG=latest" >> $GITHUB_ENV
176
- fi
177
- fi
178
-
179
- if [[ "${{ github.event_name }}" == "pull_request" ]]; then
180
- echo "Generated the following commit tags: "
181
- for TAG in "${COMMIT_TAGS[@]}"; do
182
- echo "${TAG}"
183
- done
184
- alias_tags=("${COMMIT_TAGS[@]}")
185
- else
186
- alias_tags=("${BUILD_TAGS[@]}")
187
- fi
188
- echo "Generated the following build tags: "
189
- for TAG in "${BUILD_TAGS[@]}"; do
190
- echo "${TAG}"
191
- done
192
- echo "alias_tags=${alias_tags[*]}" >> $GITHUB_OUTPUT
193
-
194
137
- name : Pull main, akmods, rechunk images
195
138
uses : Wandalen/wretry.action@v3.5.0
196
139
with :
@@ -229,6 +172,38 @@ jobs:
229
172
exit 1
230
173
fi
231
174
echo "KERNEL_VERSION=$linux" >> $GITHUB_ENV
175
+
176
+ # Generate a primary version key that appears
177
+ # in KDE, rpm-ostree status, and github.
178
+ - name : Generate Version
179
+ id : generate-version
180
+ shell : bash
181
+ run : |
182
+ # Generate the primary version key that will be stored on os-release,
183
+ # shown on the bootloader, and used for the image tag.
184
+ UPSTREAM_TAG="${{ env.SOURCE_IMAGE_VERSION }}"
185
+ FEDORA_VERSION="${{ matrix.fedora_version }}"
186
+ BAZZITE_VERSION="${{ matrix.bazzite_version }}"
187
+ SHA_SHORT="${GITHUB_SHA::7}"
188
+
189
+ if [ -n "${{ github.event.pull_request.number }}" ]; then
190
+ VERSION="pr-${FEDORA_VERSION}-${{ github.event.pull_request.number }}"
191
+ PRETTY_VERSION="PR (${{ github.event.pull_request.number }}, ${UPSTREAM_TAG})"
192
+ elif [[ ${{ github.ref_name }} == "unstable" ]]; then
193
+ VERSION="unstable-${SHA_SHORT}"
194
+ PRETTY_VERSION="Unstable (#${SHA_SHORT}, F${UPSTREAM_TAG})"
195
+ elif [[ ${{ github.ref_name }} == "testing" ]]; then
196
+ VERSION="testing-${BAZZITE_VERSION}-${UPSTREAM_TAG}"
197
+ PRETTY_VERSION="Testing (${BAZZITE_VERSION}, F${UPSTREAM_TAG})"
198
+ else
199
+ VERSION="${BAZZITE_VERSION}-${UPSTREAM_TAG}"
200
+ PRETTY_VERSION="Stable (${BAZZITE_VERSION}, F${UPSTREAM_TAG})"
201
+ fi
202
+ echo "tag=${VERSION}" >> $GITHUB_OUTPUT
203
+ echo "pretty=${PRETTY_VERSION}" >> $GITHUB_OUTPUT
204
+
205
+ echo "Generated the following:"
206
+ cat $GITHUB_OUTPUT
232
207
233
208
# Build image using buildah and save it to raw-img
234
209
- name : Build Image
@@ -245,6 +220,8 @@ jobs:
245
220
--build-arg KERNEL_FLAVOR=${{ matrix.kernel_flavor }} \
246
221
--build-arg IMAGE_BRANCH=${{ github.ref_name }} \
247
222
--build-arg SHA_HEAD_SHORT=${{ env.SHA_HEAD_SHORT }} \
223
+ --build-arg VERSION_TAG=${{ steps.generate-version.outputs.tag }} \
224
+ --build-arg VERSION_PRETTY="${{ steps.generate-version.outputs.pretty }}" \
248
225
--tag raw-img .
249
226
250
227
- name : Remove auxiliary images
@@ -265,7 +242,7 @@ jobs:
265
242
# to avoid layer shifts.
266
243
# prev-ref: ${{ github.event.inputs.fresh-rechunk == 'true' && '' || 'ghcr.io/ublue-os/bazzite:unstable' }}
267
244
rechunk : ' ghcr.io/hhd-dev/rechunk:v0.1.8'
268
- version : ' ${{ env.SOURCE_IMAGE_VERSION }}'
245
+ version : ' ${{ steps.generate-version.outputs.tag }}'
269
246
labels : |
270
247
io.artifacthub.package.logo-url=https://raw.githubusercontent.com/ublue-os/bazzite/main/repo_content/logo.png
271
248
io.artifacthub.package.readme-url=https://bazzite.gg/
@@ -276,6 +253,76 @@ jobs:
276
253
org.opencontainers.image.source=https://github.com/ublue-os/bazzite
277
254
org.opencontainers.image.title=bazzite
278
255
org.opencontainers.image.url=https://github.com/ublue-os/bazzite
256
+
257
+ # Generate tags after rechunker runs and checks the primary tag is not duplicated
258
+ # If it is, rechunk will suffix it by .1, .2, etc and put it in steps.rechunk.outputs.version
259
+ - name : Generate tags
260
+ id : generate-tags
261
+ shell : bash
262
+ run : |
263
+ # Common vars for generating tags
264
+ VERSION_TAG="${{ steps.rechunk.outputs.version }}"
265
+ UPSTREAM_TAG="${{ env.SOURCE_IMAGE_VERSION }}"
266
+ FEDORA_VERSION="${{ matrix.fedora_version }}"
267
+ BAZZITE_VERSION="${{ matrix.bazzite_version }}"
268
+ SHA_SHORT="${GITHUB_SHA::7}"
269
+ BUILD_TAGS=( "${VERSION_TAG}" )
270
+
271
+ # Use latest var to check if we should tag as latest
272
+ unset LATEST
273
+ if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
274
+ [[ "${{ matrix.is_stable_version }}" == "true" ]]; then
275
+ LATEST="1"
276
+ fi
277
+
278
+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
279
+ # Track latest ver per PR
280
+ if [ -n "$LATEST" ]; then
281
+ BUILD_TAGS+=("pr-${{ github.event.pull_request.number }}")
282
+ fi
283
+ elif [[ ${{ github.ref_name }} == "unstable" ]]; then
284
+ # Per fedora version
285
+ BUILD_TAGS+=("${FEDORA_VERSION}-unstable")
286
+ BUILD_TAGS+=("unstable-${FEDORA_VERSION}") # flip ver to be last
287
+
288
+ # Per upstream ver
289
+ BUILD_TAGS+=("unstable-${UPSTREAM_TAG}")
290
+
291
+ if [ -n "$LATEST" ]; then
292
+ BUILD_TAGS+=("unstable")
293
+ fi
294
+ elif [[ ${{ github.ref_name }} == "testing" ]]; then
295
+ # Per fedora version
296
+ BUILD_TAGS+=("${FEDORA_VERSION}-testing")
297
+ BUILD_TAGS+=("testing-${FEDORA_VERSION}") # flip ver to be last
298
+
299
+ # Per upstream ver
300
+ BUILD_TAGS+=("testing-${UPSTREAM_TAG}")
301
+
302
+ if [ -n "$LATEST" ]; then
303
+ BUILD_TAGS+=("testing-${BAZZITE_VERSION}")
304
+ BUILD_TAGS+=("testing")
305
+ fi
306
+ else
307
+ BUILD_TAGS+=("${FEDORA_VERSION}")
308
+ BUILD_TAGS+=("${UPSTREAM_TAG}")
309
+ BUILD_TAGS+=("${BAZZITE_VERSION}")
310
+ BUILD_TAGS+=("stable-${UPSTREAM_TAG}")
311
+
312
+ # Per fedora version
313
+ BUILD_TAGS+=("${FEDORA_VERSION}-stable")
314
+ BUILD_TAGS+=("stable-${FEDORA_VERSION}") # flip ver to be last
315
+
316
+ if [ -n "$LATEST" ]; then
317
+ BUILD_TAGS+=("latest" "stable")
318
+ fi
319
+ fi
320
+
321
+ echo "Generated the following build tags: "
322
+ for TAG in "${BUILD_TAGS[@]}"; do
323
+ echo "${TAG}"
324
+ done
325
+ echo "alias_tags=${BUILD_TAGS[*]}" >> $GITHUB_OUTPUT
279
326
280
327
# Pull oci-dir image, remove oci dir to make space, and then tag appropriately
281
328
- name : Load in podman and tag
0 commit comments