ci(release): run the build and both releases from a Gitea workflow
The official build and its two publications were started by hand, so a VERSION bump could stay unpublished indefinitely. Touching VERSION on Main now starts the workflow, which asks release.sh whether the version line actually changed, then builds and opens the Gitea and GitHub releases with the ISO attached.
This commit is contained in:
2 files changed
+129
-4
No files matched your search
@@ -0,0 +1,83 @@
|
||||
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: "Variante de l'ISO (cli, kde, gnome…)"
|
||||
required: false
|
||||
default: cli
|
||||
force:
|
||||
description: "Publier même sans changement de ligne de version"
|
||||
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:
|
||||
# mkarchiso needs an Arch host (pacman, chroot, loop mounts) and root, so
|
||||
# the build machine itself must be the runner. It has to be registered
|
||||
# with these labels and allow passwordless sudo.
|
||||
runs-on: [self-hosted, arch]
|
||||
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: 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 sudo; do
|
||||
command -v "${c}" >/dev/null 2>&1 \
|
||||
|| { echo "::error::${c} absent du runner"; exit 1; }
|
||||
done
|
||||
sudo -n true 2>/dev/null \
|
||||
|| { echo "::error::sudo sans mot de passe requis (mkarchiso tourne en root)"; exit 1; }
|
||||
|
||||
- name: Build officiel et publication
|
||||
if: steps.check.outputs.publish == 'true'
|
||||
env:
|
||||
# Gitea Actions fournit GITHUB_TOKEN (token du dépôt) : il suffit
|
||||
# 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 }}
|
||||
VARIANT: ${{ inputs.variant || 'cli' }}
|
||||
run: ./release.sh --variant "${VARIANT}"
|
||||
|
||||
- name: Résumé
|
||||
if: steps.check.outputs.publish == 'true'
|
||||
run: |
|
||||
{
|
||||
echo "### FWS $(cat VERSION)"
|
||||
echo ""
|
||||
echo "ISO : $(ls -1t out/v*/v*/*.iso 2>/dev/null | head -1)"
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
Reference in new issue
Block a user