Skip to content

Commit

Permalink
Publish vectors to GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlul committed Nov 10, 2023
1 parent 16ba278 commit 74dd810
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/limit-regulation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
tcg:
name: Download TCG Forbidden & Limited Lists
runs-on: ubuntu-latest
outputs:
status: ${{ steps.commit.outputs.status }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -21,12 +23,15 @@ jobs:
cache-dependency-path: yarn.lock
- run: yarn
- run: yarn download-tcg
- uses: DawnbrandBots/yaml-yugi/.github/actions/commit-push@master
- id: commit
uses: DawnbrandBots/yaml-yugi/.github/actions/commit-push@master
with:
message: "Download TCG Forbidden & Limited Lists: ${{ github.run_number }} (${{ github.run_id }})"
ocg:
name: Download OCG Forbidden & Limited Lists
runs-on: ubuntu-latest
outputs:
status: ${{ steps.commit.outputs.status }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -37,12 +42,15 @@ jobs:
- run: yarn
- run: curl -fsSLo /tmp/cards.json https://github.com/DawnbrandBots/yaml-yugi/raw/aggregate/cards.json
- run: yarn download-ocg /tmp/cards.json --recent
- uses: DawnbrandBots/yaml-yugi/.github/actions/commit-push@master
- id: commit
uses: DawnbrandBots/yaml-yugi/.github/actions/commit-push@master
with:
message: "Download OCG Forbidden & Limited Lists: ${{ github.run_number }} (${{ github.run_id }})"
rush:
name: Download Rush Duel Forbidden & Limited Lists
runs-on: ubuntu-latest
outputs:
status: ${{ steps.commit.outputs.status }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -53,12 +61,15 @@ jobs:
- run: yarn
- run: curl -fsSLo /tmp/rush.json https://github.com/DawnbrandBots/yaml-yugi/raw/aggregate/rush.json
- run: yarn download-rush /tmp/rush.json
- uses: DawnbrandBots/yaml-yugi/.github/actions/commit-push@master
- id: commit
uses: DawnbrandBots/yaml-yugi/.github/actions/commit-push@master
with:
message: "Download Rush Duel Forbidden & Limited Lists: ${{ github.run_number }} (${{ github.run_id }})"
master-duel:
name: Transform Master Duel Forbidden & Limited Lists
runs-on: ubuntu-latest
outputs:
status: ${{ steps.commit.outputs.status }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -85,7 +96,12 @@ jobs:
run: python ../../src/masterduel-extract-transform.py ../../../yaml-yugipedia/wikitext/master-duel-limit-regulation
- working-directory: yaml-yugi-limit-regulation
run: yarn transform-md /tmp/cards.json
- uses: DawnbrandBots/yaml-yugi/.github/actions/commit-push@master
- id: commit
uses: DawnbrandBots/yaml-yugi/.github/actions/commit-push@master
with:
message: "Transform Master Duel Forbidden & Limited Lists: ${{ github.run_number }} (${{ github.run_id }})"
working-directory: yaml-yugi-limit-regulation
publish:
needs: [tcg, ocg, rush, master-duel]
if: needs.*.outputs.status > 0 && !cancelled()
uses: ./.github/workflows/publish.yaml
14 changes: 6 additions & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
# SPDX-FileCopyrightText: © 2022 Kevin Lu
# SPDX-FileCopyrightText: © 2022–2023 Kevin Lu
# SPDX-Licence-Identifier: AGPL-3.0-or-later
name: Publish GitHub Pages site

on:
workflow_dispatch:
workflow_call:

jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: yaml-yugi
- uses: actions/checkout@v4
with:
path: aggregate
ref: aggregate
- run: cp aggregate/* yaml-yugi/data && rm -rf yaml-yugi/data/limit-regulation/ocg
sparse-checkout: data/**/*.vector.json
sparse-checkout-cone-mode: false
- uses: actions/upload-pages-artifact@v2
with:
path: yaml-yugi/data
path: data
deploy-pages:
needs: upload
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
Expand All @@ -32,5 +29,6 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/configure-pages@v3
- uses: actions/deploy-pages@v2
id: deployment
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ GNU Affero General Public License 3.0 or later. See [COPYING](./COPYING) for mor
In each data subdirectory, current.vector.json is a symlink pointing to the most recent effective Limit Regulation for
that game version.

- TCG: https://dawnbrandbots.github.io/yaml-yugi-limit-regulation/tcg/current.vector.json
- OCG: https://dawnbrandbots.github.io/yaml-yugi-limit-regulation/ocg/current.vector.json
- Rush Duel: https://dawnbrandbots.github.io/yaml-yugi-limit-regulation/rush/current.vector.json
- Master Duel: https://dawnbrandbots.github.io/yaml-yugi-limit-regulation/master-duel/current.vector.json

The TCG list effective 2022-05-23 was actually effective [2022-05-17](https://yugipedia.com/wiki/May_2022_Lists_(TCG)),
but Konami retconned this in its reported data at some point for some unknown reason. Fetch history:
- https://github.com/DawnbrandBots/yaml-yugi/commits/master/data/limit-regulation/tcg/2022-05-17.raw.json
Expand Down

0 comments on commit 74dd810

Please sign in to comment.