Update data and opcode #1283
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: Update data and opcode | |
on: | |
schedule: | |
# At minute 0 past every 4th hour. | |
- cron: "0 */4 * * *" | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "poetry" | |
- run: poetry install | |
- name: Setup git user | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Update opcodes | |
run: poetry run python scripts/update_opcode.py | |
- name: Commit opcode | |
id: opcode-commit | |
run: | | |
git add . | |
git diff-index --quiet HEAD || echo "DIFF=true" >> $GITHUB_OUTPUT | |
git diff-index --quiet HEAD || git commit -m "chore(opcode): update opcode" | |
- name: Update instance data | |
run: poetry run python scripts/extract_instance.py | |
- name: Update job data | |
run: poetry run python scripts/extract_job.py | |
- name: Update roulette data | |
run: poetry run python scripts/extract_roulette.py | |
- name: Commit data | |
id: data-commit | |
run: | | |
git add . | |
git diff-index --quiet HEAD || echo "DIFF=true" >> $GITHUB_OUTPUT | |
git diff-index --quiet HEAD || git commit -m "chore(data): update data" | |
- name: Push commits | |
run: git push | |
- name: Trigger build | |
if: ${{ steps.opcode-commit.outputs.DIFF == 'true' || steps.data-commit.outputs.DIFF == 'true' }} | |
run: gh workflow run build.yml | |
env: | |
GH_TOKEN: ${{ github.token }} |