Add discover
Some checks failed
nightly-build / discover (push) Successful in 2m42s
nightly-build / build (push) Failing after 57s

This commit is contained in:
KenwoodFox
2026-06-28 23:23:53 -04:00
parent 56aab1536d
commit 7c16ba2636
2 changed files with 47 additions and 3 deletions

View File

@@ -16,12 +16,47 @@ on:
default: "false"
jobs:
build:
discover:
runs-on: ubuntu-latest
container:
image: archlinux:latest
outputs:
packages: ${{ steps.list.outputs.packages }}
steps:
- name: Install toolchain
run: |
# nodejs is required by JS actions like actions/checkout.
pacman -Syu --noconfirm --needed git python nodejs
- name: Checkout
uses: actions/checkout@v4
- name: List packages
id: list
env:
ONLY: ${{ github.event.inputs.only }}
run: |
packages=$(python3 autopackage.py --list-json ${ONLY:+--only $ONLY})
echo "packages=$packages" >> "$GITHUB_OUTPUT"
echo "Matrix: $packages"
build:
needs: discover
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
container:
image: archlinux:latest
# makepkg refuses to run as root; we create a build user below.
options: --privileged
strategy:
# Build every package even if one fails.
fail-fast: false
# Tune to your runner capacity; remove for unlimited parallelism.
max-parallel: 3
matrix:
pkg: ${{ fromJSON(needs.discover.outputs.packages) }}
steps:
- name: Install toolchain
run: |
@@ -48,8 +83,8 @@ jobs:
AUTOPKG_USER: ${{ github.actor }}
AUTOPKG_TOKEN: ${{ secrets.PACKAGE_TOKEN || github.token }}
AUTOPKG_REPLACE: ${{ github.event.inputs.replace }}
ONLY: ${{ github.event.inputs.only }}
PKG: ${{ matrix.pkg }}
run: |
# -E keeps AUTOPKG_*; force HOME to builder's so cargo/git/etc. can write their caches
sudo -E -u builder env HOME=/home/builder \
python3 autopackage.py --keep-going ${ONLY:+--only $ONLY}
python3 autopackage.py --only "$PKG"