Files
packages-arch/.gitea/workflows/nightly.yml
2026-06-28 23:51:20 -04:00

77 lines
2.5 KiB
YAML

name: nightly-build
on:
schedule:
# 03:30 UTC every night
- cron: "30 3 * * *"
workflow_dispatch:
inputs:
replace:
description: "Replace existing registry files on version clash"
required: false
default: "false"
jobs:
build:
runs-on: ubuntu-latest
# Grant the auto-provisioned github.token write access to the package
# registry (otherwise uploads get HTTP 401 reqPackageAccess).
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:
# Keep this list in sync with the package directories in the repo
# (one entry per top-level folder). Dynamic discovery from a job
# output needs a newer Gitea (PR #36564); until then, hardcode here.
pkg:
- bacula
- fchat-horizon-appimage
- ggml-git-latest-commit
- openrgb-git
- paru
- plezy-bin
- qownnotes
- ventoy-bin
- visual-studio-code-bin
steps:
- name: Install toolchain
run: |
# nodejs is required by JS actions like actions/checkout.
pacman -Syu --noconfirm --needed base-devel git python sudo nodejs
- name: Create build user
run: |
useradd -m -s /bin/bash builder
echo "builder ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/builder
chmod 0440 /etc/sudoers.d/builder
- name: Checkout
uses: actions/checkout@v4
- name: Fix permissions
run: chown -R builder:builder "$GITHUB_WORKSPACE"
- name: Build and publish
env:
AUTOPKG_REGISTRY_URL: ${{ github.server_url }}
AUTOPKG_OWNER: ${{ github.repository_owner }}
AUTOPKG_REPO: arch
AUTOPKG_USER: ${{ github.actor }}
AUTOPKG_TOKEN: ${{ secrets.PACKAGE_TOKEN || github.token }}
AUTOPKG_REPLACE: ${{ github.event.inputs.replace }}
AUTOPKG_SKIP_PGP: "1" # Womp womp
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 --only "$PKG"