|
| 1 | +name: Update Games and Index |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + - cron: '0 0 1 * *' # At 00:00 on day-of-month 1. |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + actions: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + update-games: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Free additional disk space |
| 18 | + run: | |
| 19 | + sudo apt purge -yq $( |
| 20 | + dpkg -l | |
| 21 | + grep '^ii' | |
| 22 | + awk '{ print $2 }' | |
| 23 | + grep -P '(mecab|linux-azure-tools-|aspnetcore|liblldb-|netstandard-|clang-tidy|clang-format|gfortran-|mysql-|google-cloud-cli|postgresql-|cabal-|dotnet-|ghc-|mongodb-|libmono|llvm-16|llvm-17)' |
| 24 | + ) || true |
| 25 | + sudo apt purge -yq \ |
| 26 | + snapd kubectl podman ruby3.2-doc mercurial-common git-lfs \ |
| 27 | + skopeo buildah vim python3-botocore azure-cli powershell \ |
| 28 | + shellcheck firefox google-chrome-stable microsoft-edge-stable || true |
| 29 | + sudo apt autoremove -yq |
| 30 | + sudo apt clean |
| 31 | +
|
| 32 | + - name: Install Git |
| 33 | + run: | |
| 34 | + sudo apt-get update |
| 35 | + sudo apt-get install -y git |
| 36 | +
|
| 37 | + - name: Checkout repository |
| 38 | + uses: actions/checkout@v4 |
| 39 | + with: |
| 40 | + fetch-depth: 0 |
| 41 | + |
| 42 | + - name: Configure Git Performance |
| 43 | + run: | |
| 44 | + git config --global pack.threads 0 |
| 45 | +
|
| 46 | + - name: Set up Python |
| 47 | + uses: actions/setup-python@v5 |
| 48 | + with: |
| 49 | + python-version: '3.11' |
| 50 | + |
| 51 | + - name: Run Manifest Grabber (Timeout Safe) |
| 52 | + id: manifest |
| 53 | + continue-on-error: true |
| 54 | + run: | |
| 55 | + # Run for up to 350 minutes (5h 50m) to leave time for commit/push |
| 56 | + timeout 350m python mainfest.py --cleanup -v || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi |
| 57 | +
|
| 58 | + - name: Commit and push changes |
| 59 | + if: always() # Run even if the python script timed out |
| 60 | + uses: stefanzweifel/git-auto-commit-action@v5 |
| 61 | + with: |
| 62 | + commit_message: "chore: update game manifests [skip ci]" |
| 63 | + file_pattern: games/*.lua |
| 64 | + branch: main |
| 65 | + |
| 66 | + - name: Trigger Index Generation |
| 67 | + if: always() # Run even if previous steps failed/timed out, as long as we have something |
| 68 | + env: |
| 69 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 70 | + run: | |
| 71 | + gh workflow run generate-index.yml |
0 commit comments