Symbol updater #125
This file contains 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: Symbol updater | |
permissions: read-all | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "20 4 * * *" | |
jobs: | |
run: | |
runs-on: ${{ matrix.operating-system }} | |
name: PHP ${{ matrix.php-versions }} - Collect | |
strategy: | |
matrix: | |
operating-system: ['ubuntu-latest'] | |
php-versions: | |
- '7.2' | |
- '7.3' | |
- '7.4' | |
- '8.0' | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
- '8.4' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Display versions and env | |
run: | | |
php -v | |
php -m | |
- name: Dump data | |
run: | | |
php bin/dump.php | |
- name: Upload data | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.php-versions }} | |
path: scratch | |
collect: | |
needs: run | |
runs-on: ubuntu-latest | |
name: Collect and Commit Data | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout main repo | |
- uses: actions/checkout@v4 | |
name: Checkout data repo | |
with: | |
repository: PHPWatch/PHP-Symbols | |
path: data | |
token: ${{ secrets.DATA_REPO_PAT }} | |
- name: Collect data | |
uses: actions/download-artifact@v3 | |
with: | |
path: scratch | |
- name: Prime files | |
run: | | |
cp scratch/* data/ -Rf | |
- name: List dirs | |
run: find data | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/" | |
- name: Commit data | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "Update database" | |
branch: main | |
repository: data |