Nightly: a re-run publishes under its own number
Starting a run again keeps its run number, so a second attempt would have built new images for the paths the first attempt had already partly filled, and the upload refuses to replace a file. From the second attempt on, the attempt is part of the number: 431, then 431.2.
This commit is contained in:
1 parent
4f7d4a9db3
commit
d054c00d24
1 file changed
+6
-2
@@ -61,7 +61,11 @@ jobs:
|
|||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
edge=$(date -u +%Y.%m.%d).${{ github.run_number }}
|
# A run that is started again makes its images again, and they are
|
||||||
|
# not the same bytes: it gets its own number too.
|
||||||
|
build=${{ github.run_number }}
|
||||||
|
[[ ${{ github.run_attempt }} == 1 ]] || build+=.${{ github.run_attempt }}
|
||||||
|
edge=$(date -u +%Y.%m.%d).$build
|
||||||
stable=$(gh api repos/omacom/omarchy/releases/latest --jq .tag_name)
|
stable=$(gh api repos/omacom/omarchy/releases/latest --jq .tag_name)
|
||||||
stable=${stable#v}
|
stable=${stable#v}
|
||||||
[[ $stable =~ ^[0-9]+(\.[0-9]+)+$ ]] || { echo "::error::omacom/omarchy's latest release is '$stable', not a version"; exit 1; }
|
[[ $stable =~ ^[0-9]+(\.[0-9]+)+$ ]] || { echo "::error::omacom/omarchy's latest release is '$stable', not a version"; exit 1; }
|
||||||
@@ -70,7 +74,7 @@ jobs:
|
|||||||
if [[ $GITHUB_EVENT_NAME == schedule && $published == "$stable" ]]; then
|
if [[ $GITHUB_EVENT_NAME == schedule && $published == "$stable" ]]; then
|
||||||
echo "stable $stable is already published"
|
echo "stable $stable is already published"
|
||||||
else
|
else
|
||||||
channels=$(jq -c --arg stable "$stable" --arg run "${{ github.run_number }}" \
|
channels=$(jq -c --arg stable "$stable" --arg run "$build" \
|
||||||
'. + [{channel: "stable", version: $stable, release: "stable/\($stable)/\($run)"}]' <<<"$channels")
|
'. + [{channel: "stable", version: $stable, release: "stable/\($stable)/\($run)"}]' <<<"$channels")
|
||||||
fi
|
fi
|
||||||
echo "channels=$channels" | tee -a "$GITHUB_OUTPUT"
|
echo "channels=$channels" | tee -a "$GITHUB_OUTPUT"
|
||||||
|
|||||||
Reference in new issue
Block a user