Add vendored dependencies and improve first-run setup #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update vendored dependencies | |
| on: | |
| schedule: | |
| # Every Sunday at 04:17 UTC (07:17 in Greece during summer time). | |
| - cron: "17 4 * * 0" | |
| workflow_dispatch: | |
| push: | |
| # Populate the real caches immediately after this system or its manifests change. | |
| paths: | |
| - ".github/workflows/update-needs.yml" | |
| - "Needs/Maintenance/**" | |
| - "Needs/Modules/requirements.txt" | |
| - "Needs/Packages/*.txt" | |
| - "Needs/Packages/export_cache_lock.py" | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: update-vendored-dependencies | |
| cancel-in-progress: false | |
| jobs: | |
| update-needs: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 240 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Prepare maintenance environment | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel packaging | |
| - name: Build complete replacement in staging | |
| run: | | |
| python Needs/Maintenance/update_vendored_dependencies.py | |
| - name: Export exact package lock | |
| run: | | |
| python Needs/Packages/export_cache_lock.py | |
| - name: Validate complete replacement | |
| run: | | |
| python Needs/verify_needs.py --cache | |
| - name: Preserve verified replacement as workflow artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dedsec-needs-${{ github.run_id }} | |
| path: | | |
| Needs/Modules/Cache | |
| Needs/Packages/Cache | |
| Needs/Packages/package-lock-*.json | |
| Needs/Packages/download-plan-*.tsv | |
| compression-level: 0 | |
| retention-days: 14 | |
| - name: Commit refreshed caches | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add \ | |
| Needs/Modules/Cache \ | |
| Needs/Packages/Cache \ | |
| Needs/Packages/package-lock-*.json \ | |
| Needs/Packages/download-plan-*.tsv | |
| if git diff --cached --quiet; then | |
| echo "No dependency updates were found." | |
| exit 0 | |
| fi | |
| git commit -m "chore: refresh vendored dependencies" | |
| git push |