Skip to content

Generation

Generation #209

Workflow file for this run

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 'github-actions@users.noreply.github.com'
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