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.
99 lines
3.3 KiB
YAML
99 lines
3.3 KiB
YAML
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.
|
|
on:
|
|
push:
|
|
branches: [Main]
|
|
paths:
|
|
- VERSION
|
|
workflow_dispatch:
|
|
inputs:
|
|
variant:
|
|
description: "Étiquette de l'ISO (multi = tous les bureaux, le choix se fait à l'installation)"
|
|
required: false
|
|
default: multi
|
|
force:
|
|
description: "Publier même sans changement de ligne de version"
|
|
type: boolean
|
|
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.
|
|
concurrency:
|
|
group: release
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
release:
|
|
# Organisation runners: labels arch-host, ubuntu-latest, debian, alpine.
|
|
# mkarchiso needs an Arch environment, root, loop devices and mount, so the
|
|
# job must run privileged (act_runner: container.privileged = true).
|
|
runs-on: arch-host
|
|
timeout-minutes: 180
|
|
|
|
steps:
|
|
- name: Récupérer le dépôt avec ses tags
|
|
uses: actions/checkout@v4
|
|
with:
|
|
# The version-line rule reads the released tags.
|
|
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 ?
|
|
id: check
|
|
env:
|
|
FORCE: ${{ inputs.force }}
|
|
run: |
|
|
if [ "${FORCE}" = "true" ]; then
|
|
./release.sh --check --force
|
|
else
|
|
./release.sh --check
|
|
fi
|
|
|
|
- name: Pré-vol du runner
|
|
if: steps.check.outputs.publish == 'true'
|
|
run: |
|
|
for c in bash curl jq git pacman; do
|
|
command -v "${c}" >/dev/null 2>&1 \
|
|
|| { echo "::error::${c} absent du runner"; exit 1; }
|
|
done
|
|
# mkarchiso needs root: either the job already runs as root, or the
|
|
# 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
|
|
if: steps.check.outputs.publish == 'true'
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.FWS_GITEA_TOKEN }}
|
|
GITHUB_TOKEN: ${{ secrets.FWS_GITHUB_TOKEN }}
|
|
VARIANT: ${{ inputs.variant || 'multi' }}
|
|
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é
|
|
if: steps.check.outputs.publish == 'true'
|
|
run: |
|
|
[ -n "${GITHUB_STEP_SUMMARY:-}" ] || exit 0
|
|
{
|
|
echo "### FWS $(cat VERSION)"
|
|
echo ""
|
|
echo "ISO : $(ls -1t out/v*/v*/*.iso 2>/dev/null | head -1)"
|
|
} >> "${GITHUB_STEP_SUMMARY}"
|