ci(release): target the org runner and default to the multi-desktop ISO
The org runners are labelled arch-host, so the previous self-hosted/arch pair never matched anything. The ISO carries every desktop and the choice is made in the installer, so the variant is only a filename label and multi is the default. A dry_run input exercises the whole chain without a build, which is how the workflow gets validated after a change.
This commit is contained in:
1 file changed
+31
-16
@@ -13,13 +13,17 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
variant:
|
variant:
|
||||||
description: "Variante de l'ISO (cli, kde, gnome…)"
|
description: "Étiquette de l'ISO (multi = tous les bureaux, le choix se fait à l'installation)"
|
||||||
required: false
|
required: false
|
||||||
default: cli
|
default: multi
|
||||||
force:
|
force:
|
||||||
description: "Publier même sans changement de ligne de version"
|
description: "Publier même sans changement de ligne de version"
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
dry_run:
|
||||||
|
description: "Vérifier la chaîne sans builder ni publier"
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
# One release at a time: a build holds root, loop devices and ~20 min.
|
# One release at a time: a build holds root, loop devices and ~20 min.
|
||||||
concurrency:
|
concurrency:
|
||||||
@@ -28,10 +32,10 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
# mkarchiso needs an Arch host (pacman, chroot, loop mounts) and root, so
|
# Organisation runners: labels arch-host, ubuntu-latest, debian, alpine.
|
||||||
# the build machine itself must be the runner. It has to be registered
|
# mkarchiso needs an Arch environment, root, loop devices and mount, so the
|
||||||
# with these labels and allow passwordless sudo.
|
# job must run privileged (act_runner: container.privileged = true).
|
||||||
runs-on: [self-hosted, arch]
|
runs-on: arch-host
|
||||||
timeout-minutes: 180
|
timeout-minutes: 180
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -41,6 +45,9 @@ jobs:
|
|||||||
# The version-line rule reads the released tags.
|
# The version-line rule reads the released tags.
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Git — accepter le dépôt monté par le runner
|
||||||
|
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}" || true
|
||||||
|
|
||||||
- name: Faut-il publier ?
|
- name: Faut-il publier ?
|
||||||
id: check
|
id: check
|
||||||
env:
|
env:
|
||||||
@@ -55,29 +62,37 @@ jobs:
|
|||||||
- name: Pré-vol du runner
|
- name: Pré-vol du runner
|
||||||
if: steps.check.outputs.publish == 'true'
|
if: steps.check.outputs.publish == 'true'
|
||||||
run: |
|
run: |
|
||||||
for c in bash curl jq git sudo; do
|
for c in bash curl jq git pacman; do
|
||||||
command -v "${c}" >/dev/null 2>&1 \
|
command -v "${c}" >/dev/null 2>&1 \
|
||||||
|| { echo "::error::${c} absent du runner"; exit 1; }
|
|| { echo "::error::${c} absent du runner"; exit 1; }
|
||||||
done
|
done
|
||||||
sudo -n true 2>/dev/null \
|
# mkarchiso needs root: either the job already runs as root, or the
|
||||||
|| { echo "::error::sudo sans mot de passe requis (mkarchiso tourne en root)"; exit 1; }
|
# runner allows passwordless sudo.
|
||||||
|
[ "$(id -u)" -eq 0 ] || sudo -n true 2>/dev/null \
|
||||||
|
|| { echo "::error::mkarchiso exige root (job root ou sudo sans mot de passe)"; exit 1; }
|
||||||
|
|
||||||
- name: Build officiel et publication
|
- name: Build officiel et publication
|
||||||
if: steps.check.outputs.publish == 'true'
|
if: steps.check.outputs.publish == 'true'
|
||||||
env:
|
env:
|
||||||
# Gitea Actions fournit GITHUB_TOKEN (token du dépôt) : il suffit
|
GITEA_TOKEN: ${{ secrets.FWS_GITEA_TOKEN }}
|
||||||
# quand il peut écrire les releases. Sinon, secrets.FWS_GITEA_TOKEN.
|
|
||||||
GITEA_TOKEN: ${{ secrets.FWS_GITEA_TOKEN || secrets.GITHUB_TOKEN }}
|
|
||||||
# PAT GitHub avec le droit de créer des releases sur fws-linux/ISO.
|
|
||||||
GITHUB_TOKEN: ${{ secrets.FWS_GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.FWS_GITHUB_TOKEN }}
|
||||||
VARIANT: ${{ inputs.variant || 'cli' }}
|
VARIANT: ${{ inputs.variant || 'multi' }}
|
||||||
run: ./release.sh --variant "${VARIANT}"
|
DRY_RUN: ${{ inputs.dry_run }}
|
||||||
|
run: |
|
||||||
|
if [ "${DRY_RUN}" = "true" ]; then
|
||||||
|
# Same preflight and notes as a real run, without the build or any
|
||||||
|
# publication: how the chain is validated after a change.
|
||||||
|
./release.sh --dry-run --variant "${VARIANT}"
|
||||||
|
else
|
||||||
|
./release.sh --variant "${VARIANT}"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Résumé
|
- name: Résumé
|
||||||
if: steps.check.outputs.publish == 'true'
|
if: steps.check.outputs.publish == 'true'
|
||||||
run: |
|
run: |
|
||||||
|
[ -n "${GITHUB_STEP_SUMMARY:-}" ] || exit 0
|
||||||
{
|
{
|
||||||
echo "### FWS $(cat VERSION)"
|
echo "### FWS $(cat VERSION)"
|
||||||
echo ""
|
echo ""
|
||||||
echo "ISO : $(ls -1t out/v*/v*/*.iso 2>/dev/null | head -1)"
|
echo "ISO : $(ls -1t out/v*/v*/*.iso 2>/dev/null | head -1)"
|
||||||
} >> "$GITHUB_STEP_SUMMARY"
|
} >> "${GITHUB_STEP_SUMMARY}"
|
||||||
Reference in new issue
Block a user