Skip to content

Commit fe3273d

Browse files
Merge pull request #166 from Luap99/v5.6-backport
[v5.6] Add "latest" logic to automated releases
2 parents 547dd77 + 04a239a commit fe3273d

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.cirrus.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,26 @@ publish_images_task:
227227
popd
228228
229229
gh auth login --with-token <<<"$RELEASE_TOKEN"
230+
231+
if [[ $CIRRUS_TAG == *-rc* ]]; then
232+
RC="--prerelease"
233+
else
234+
# check if this version should not be marked latest
235+
prevvers=$(gh api repos/containers/podman-machine-os/releases/latest --jq '.tag_name')
236+
echo "${prevvers},${CIRRUS_TAG}"
237+
# sort -V -C returns 0 if args are ascending version order
238+
if !(echo "${prevvers},${CIRRUS_TAG}" | tr ',' '\n' | sort -V -C)
239+
then
240+
LATEST="--latest=false"
241+
fi
242+
fi
243+
230244
gh release create $CIRRUS_TAG \
231245
-t $CIRRUS_TAG \
232246
--notes "$CIRRUS_TAG release images" \
233247
--verify-tag \
248+
$RC \
249+
$LATEST \
234250
$OUTDIR/*
235251
gh auth logout
236252
fi

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mkdir -p ./rpms
2525
set +e
2626
if [[ ${PODMAN_PR_NUM} != "" ]]; then
2727
pushd ./rpms
28-
for pkg in container-selinux crun;
28+
for pkg in crun;
2929
do
3030
for tag in "${FEDORA_VERSION}"-updates-candidate "${FEDORA_VERSION}"-updates-testing "${FEDORA_VERSION}"-updates-testing-pending;
3131
do

0 commit comments

Comments
 (0)