-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (45 loc) · 2.04 KB
/
update-showdown-data.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: update-showdown-data
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: cerbottana
- name: Clone pokemon showdown
uses: actions/checkout@v4
with:
repository: smogon/pokemon-showdown
path: pokemon-showdown
- name: Set up node
uses: actions/setup-node@v4
- name: Build pokemon showdown
run: pokemon-showdown/build
- name: Download minidex files
run: |
wget -O pokedex-mini.js https://play.pokemonshowdown.com/data/pokedex-mini.js
wget -O pokedex-mini-bw.js https://play.pokemonshowdown.com/data/pokedex-mini-bw.js
- name: Update showdown data
run: |
echo 'const fs = require("fs");
const Sim = require("./pokemon-showdown");
fs.writeFileSync("cerbottana/cerbottana/data/showdown/aliases.json", JSON.stringify(Sim.Dex.data.Aliases, null, 2) + "\n");
fs.writeFileSync("cerbottana/cerbottana/data/showdown/pokedex.json", JSON.stringify(Sim.Dex.data.Pokedex, null, 2) + "\n");
fs.writeFileSync("cerbottana/cerbottana/data/showdown/pokedex-mini.json", JSON.stringify(require("./pokedex-mini.js").BattlePokemonSprites, null, 2) + "\n");
fs.writeFileSync("cerbottana/cerbottana/data/showdown/pokedex-mini-bw.json", JSON.stringify(require("./pokedex-mini-bw.js").BattlePokemonSpritesBW, null, 2) + "\n");
' | node -
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
path: cerbottana
token: ${{ secrets.MACHINE_USER_PAT }}
push-to-fork: prnss/cerbottana
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
commit-message: "Showdown: update data"
title: "Showdown: update data"
branch: showdown-update-data