-
-
Notifications
You must be signed in to change notification settings - Fork 54
60 lines (56 loc) · 1.94 KB
/
generation.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
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Generation
on:
workflow_dispatch:
schedule:
# Run once a week (Sunday 00:00)
- cron: "0 0 * * 0"
jobs:
gen:
name: Regenerating types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cloning SteamDatabase/GameTracking-CSGO
uses: actions/checkout@v2
with:
repository: SteamDatabase/GameTracking-CSGO
path: GameTracking-CSGO
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Upgrade NPM
run: npm install -g npm
- name: Install packages
run: npm ci
- name: Build TypeScript
run: npm run build
- name: Download recent demo from HLTV
working-directory: ./demos
run: ./download-latest.sh
- name: Generating eventtypes.ts
run: node dist/generators/eventtypes.js demos/latest.dem > src/eventtypes.ts
- name: Generating sendtabletypes.ts
run: node dist/generators/sendtabletypes.js demos/latest.dem > src/sendtabletypes.ts
- name: Generating itemdefs.ts
run: node dist/generators/itemdefs.js GameTracking-CSGO/csgo > src/entities/itemdefs.ts
- name: Compile protobufs to TypeScript
run: |
./generate-protobufs.sh
node dist/generators/usermessagetypes.js src/protobufs/cstrike15_usermessages.proto > src/usermessagetypes.ts
- name: Reformat, lint and build
run: |
npm run lint --fix
npm run format
npm run build
- name: Commit changes to master
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add -A src
if git diff --name-only --cached --exit-code; then
echo "No changes to commit"
else
git commit -m "Regenerating types off latest CSGO"
git push
fi