Files
packages/.github/workflows/autobuild.yml
T
Gilver 3491ccb8ab chore(ci): Update GitHub Actions (#9324)
* chore: Update GitHub Actions

* hack: Trigger a build

Signed-off-by: Gilver <roachy@fyralabs.com>

* chore: Revert

Signed-off-by: Gilver <roachy@fyralabs.com>

---------

Signed-off-by: Gilver <roachy@fyralabs.com>
2026-01-19 09:54:45 -06:00

109 lines
3.5 KiB
YAML

# for each folder in anda/
# generate a new workflow for each folder in anda/
name: Automatically build packages
permissions:
contents: read
on:
push:
paths:
- anda/**
branches:
- frawhide
pull_request:
branches:
- frawhide
merge_group:
branches:
- frawhide
workflow_dispatch:
workflow_call:
jobs:
manifest:
runs-on: ubuntu-24.04-arm
outputs:
build_matrix: ${{ steps.generate_build_matrix.outputs.build_matrix }}
container:
image: ghcr.io/terrapkg/builder:frawhide
options: --cap-add=SYS_ADMIN --privileged
steps:
- name: Set workspace as safe
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Generate build matrix
id: generate_build_matrix
run: anda ci >> $GITHUB_OUTPUT
build:
needs: manifest
uses: ./.github/workflows/json-build.yml
secrets: inherit
with:
packages: ${{ needs.manifest.outputs.build_matrix }}
publish: ${{ github.event_name == 'push' }}
appstream:
needs: build
runs-on: ubuntu-latest
container:
image: ghcr.io/terrapkg/appstream-generator:main
steps:
- name: Download artifacts
uses: actions/download-artifact@v7
with:
merge-multiple: true
path: ./artifacts
- name: Generate test catalog
# run appstream-builder, then add step summary
run: |
set -x
appstream-builder -v \
--packages-dir=artifacts/rpms \
--icons-dir=icons \
--include-failed \
--output-dir=output \
--uncompressed-icons \
--origin=test \
--basename=test \
--veto-ignore=missing-parents \
--veto-ignore=missing-info 2>&1 | tee asb.log
- name: Export logs
id: export_logs
run: |
echo "## AppStream Builder Log" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```log' >> $GITHUB_STEP_SUMMARY
cat asb.log >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo '---' >> $GITHUB_STEP_SUMMARY
- name: Report Summary
id: report_summary
run: |
echo "## AppStream Builder Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if grep -q "veto" asb.log; then
echo "::group::Vetoed packages"
echo "### Vetoed packages" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```xml' >> $GITHUB_STEP_SUMMARY
echo "$(grep -i 'veto' asb.log)" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "::warning file=asb.log::Some packages were vetoed during AppStream generation. Please review the 'Vetoed packages' section in the summary for details."
echo "::endgroup::"
fi
echo "## Full Data Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Generated Appstream files:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
for file in output/*.xml.gz; do
echo "#### \`$file\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```xml' >> $GITHUB_STEP_SUMMARY
zcat "$file" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
done