Start the 0.9 line so the release workflow builds the ISO and publishes it on Gitea and GitHub with the image attached. The decide step now refuses to run when the checkout carries no tag: without them the version-line rule reads every VERSION as a new line and publishes a patch release. release.sh reads the last released tag with sed instead of grep, so a repository without tags reaches its "first release" case instead of dying under pipefail, and a dry run no longer demands the production tokens it never uses.
This commit is contained in:
3 files changed
+23
-10
No files matched your search
@@ -3,8 +3,9 @@ name: Release
|
||||
# Publishes a new version line: official build, then the release on Gitea and
|
||||
# on GitHub with the ISO attached.
|
||||
#
|
||||
# Triggered when VERSION changes on Main (an intermediate commit that touches
|
||||
# other files as well does not fire it), and manually from the Actions tab.
|
||||
# Triggered when VERSION changes on Main (any push that touches VERSION fires
|
||||
# it, even alongside other files: the path filter is an OR), and manually from
|
||||
# the Actions tab.
|
||||
on:
|
||||
push:
|
||||
branches: [Main]
|
||||
@@ -57,6 +58,11 @@ jobs:
|
||||
env:
|
||||
FORCE: ${{ inputs.force }}
|
||||
run: |
|
||||
# The version-line rule reads the released tags: a checkout without
|
||||
# them (fetch-depth: 0 dropped) would see every VERSION as a new line
|
||||
# and publish a patch release.
|
||||
[ -n "$(git tag -l)" ] \
|
||||
|| { echo "::error::aucun tag dans le checkout — fetch-depth: 0 est requis"; exit 1; }
|
||||
if [ "${FORCE}" = "true" ]; then
|
||||
./release.sh --check --force
|
||||
else
|
||||
|
||||
+14
-7
@@ -99,9 +99,11 @@ TAG="v$VERSION"
|
||||
# ─── Nouvelle ligne de version ? ─────────────────────────────────────────────
|
||||
# Previous released version = highest tag, normalized (repo history has both
|
||||
# "0.6.0" and "V0.8.1" spellings).
|
||||
# sed, not grep: under `set -o pipefail` a tag list without a version would
|
||||
# end the script here, before the "no tag" case below.
|
||||
PREV_VERSION="$(git -C "$WORK_DIR" tag -l \
|
||||
| grep -E '^[vV]?[0-9]+\.[0-9]+\.[0-9]+$' \
|
||||
| sed 's/^[vV]//' | sort -V | tail -1)"
|
||||
| sed -n 's/^[vV]\{0,1\}\([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\)$/\1/p' \
|
||||
| sort -V | tail -1)"
|
||||
|
||||
if [ -z "$PREV_VERSION" ]; then
|
||||
MODE="release"
|
||||
@@ -174,11 +176,16 @@ GITEA_TOKEN="${GITEA_TOKEN:-$(token_from_notes '^[0-9a-f]{40}$')}"
|
||||
# GitHub classic and fine-grained tokens share no prefix, so both are tried.
|
||||
GITHUB_TOKEN="${GITHUB_TOKEN:-$(token_from_notes 'gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,}')}"
|
||||
|
||||
[ -n "$GITEA_TOKEN" ] \
|
||||
|| die "Token Gitea absent : export GITEA_TOKEN=… ou ajoute-le à $TOKENS_FILE."
|
||||
[ -n "$GITHUB_TOKEN" ] \
|
||||
|| die "Token GitHub absent : export GITHUB_TOKEN=… ou ajoute-le à $TOKENS_FILE."
|
||||
success "Tokens Gitea et GitHub chargés."
|
||||
# A dry run touches neither forge, so it must stay usable without secrets.
|
||||
if [ "$DRY_RUN" -eq 1 ]; then
|
||||
info "[dry-run] jetons non requis."
|
||||
else
|
||||
[ -n "$GITEA_TOKEN" ] \
|
||||
|| die "Token Gitea absent : export GITEA_TOKEN=… ou ajoute-le à $TOKENS_FILE."
|
||||
[ -n "$GITHUB_TOKEN" ] \
|
||||
|| die "Token GitHub absent : export GITHUB_TOKEN=… ou ajoute-le à $TOKENS_FILE."
|
||||
success "Tokens Gitea et GitHub chargés."
|
||||
fi
|
||||
|
||||
# ─── Pré-vol des forges ──────────────────────────────────────────────────────
|
||||
# --retry-all-errors: an ISO upload can fail on a DNS hiccup halfway through,
|
||||
|
||||
Reference in new issue
Block a user