Another attempt at auto-compiling the card db (#340)
This commit is contained in:
parent
92607edb5d
commit
f5c5008ba5
22
.github/workflows/compile_card_db.yml
vendored
22
.github/workflows/compile_card_db.yml
vendored
@ -1,6 +1,6 @@
|
|||||||
name: Compile Card DB
|
name: Compile Card DB
|
||||||
|
|
||||||
on: [pull_request_target, workflow_dispatch]
|
on: [pull_request, workflow_dispatch]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compile_card_db:
|
compile_card_db:
|
||||||
@ -15,12 +15,16 @@ jobs:
|
|||||||
pip install .
|
pip install .
|
||||||
- name: Update Languages
|
- name: Update Languages
|
||||||
run: doit update_languages
|
run: doit update_languages
|
||||||
- name: Make PR
|
- uses: dorny/paths-filter@v2
|
||||||
uses: peter-evans/create-pull-request@v3
|
id: filter
|
||||||
with:
|
with:
|
||||||
base: ${{ github.head_ref }}
|
base: HEAD
|
||||||
body: |
|
filters: |
|
||||||
Auto-generate package card DB to from source card DB
|
cardb_target:
|
||||||
delete-branch: true
|
- src/domdiv/card_db/**
|
||||||
reviewers: sumpfork
|
- name: Create Artifact
|
||||||
assignees: sumpfork
|
uses: actions/upload-artifact@v2
|
||||||
|
if: steps.filter.outputs.cardb_target == 'true'
|
||||||
|
with:
|
||||||
|
name: card_db
|
||||||
|
path: src/domdiv/card_db/
|
||||||
|
|||||||
43
.github/workflows/make_card_db_pr.yml
vendored
Normal file
43
.github/workflows/make_card_db_pr.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
name: Make Card DB PR
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Compile Card DB"]
|
||||||
|
types:
|
||||||
|
-completed
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
make_pr:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/github-script@v3.1.0
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
var artifacts = await github.actions.listWorkflowRunArtifacts({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
run_id: ${{github.event.workflow_run.id }},
|
||||||
|
});
|
||||||
|
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
|
||||||
|
return artifact.name == "card_db"
|
||||||
|
})[0];
|
||||||
|
var download = await github.actions.downloadArtifact({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
artifact_id: matchArtifact.id,
|
||||||
|
archive_format: 'zip',
|
||||||
|
});
|
||||||
|
var fs = require('fs');
|
||||||
|
fs.writeFileSync('${{github.workspace}}/card_db.zip', Buffer.from(download.data));
|
||||||
|
- run: unzip -d src/domdiv/card_db card_db.zip
|
||||||
|
- run: rm -f card_db.zip
|
||||||
|
- name: Make PR
|
||||||
|
uses: peter-evans/create-pull-request@v3
|
||||||
|
with:
|
||||||
|
body: |
|
||||||
|
Auto-generate package card DB to from source card DB
|
||||||
|
delete-branch: true
|
||||||
|
reviewers: sumpfork
|
||||||
|
assignees: sumpfork
|
||||||
Loading…
x
Reference in New Issue
Block a user