67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
name: Generate Treefiles
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
paths:
|
|
- 'variants/**'
|
|
- 'package-groups/**'
|
|
- 'scripts/**'
|
|
- 'create-debian-atomic.py'
|
|
pull_request:
|
|
branches: [ main, develop ]
|
|
paths:
|
|
- 'variants/**'
|
|
- 'package-groups/**'
|
|
- 'scripts/**'
|
|
- 'create-debian-atomic.py'
|
|
|
|
jobs:
|
|
generate-treefiles:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Generate treefiles
|
|
run: |
|
|
python create-debian-atomic.py --generate-treefiles
|
|
|
|
- name: Check for changes
|
|
id: check_changes
|
|
run: |
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
echo "changes=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "changes=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Commit generated treefiles
|
|
if: steps.check_changes.outputs.changes == 'true'
|
|
run: |
|
|
git config --local user.email "forgejo@example.com"
|
|
git config --local user.name "Forgejo Actions"
|
|
git add treefiles/
|
|
git commit -m "Auto-generate treefiles from variant definitions [skip ci]"
|
|
git push
|
|
|
|
- name: Validate treefiles
|
|
run: |
|
|
python test-integration.py --validate-treefiles
|
|
|
|
- name: Test all variants
|
|
run: |
|
|
python test-all-variants.py --quick-test
|