Generation #220
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |