Skip to content

Update C# SDK serialized game data #4129

Update C# SDK serialized game data

Update C# SDK serialized game data #4129

Workflow file for this run

name: Update C# SDK serialized game data
on:
workflow_dispatch:
schedule:
- cron: '42 * * * *'
jobs:
cereal-cs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update bindings
run:
git submodule update --init --remote scripts/cereal-cs/bindings
- name: Checkout game data repo
uses: actions/checkout@v4
with:
repository: BitCraftToolBox/BitCraft_GameData
ref: cereal/cs
path: workspace/data/cereal-cs
token: ${{ secrets.ACTIONS_TOKEN }}
- name: Set up DotNet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Remove old data
run: rm -rf workspace/data/cereal-cs/*
- name: Run data script
id: update-data
env:
BITCRAFT_SPACETIME_HOST: ${{ secrets.BITCRAFT_SPACETIME_HOST }}
BITCRAFT_GLOBAL_MODULE: ${{ secrets.BITCRAFT_GLOBAL_MODULE }}
BITCRAFT_REGION_MODULE: ${{ secrets.BITCRAFT_REGION_MODULE }}
BITCRAFT_BEARER_TOKEN: ${{ secrets.BITCRAFT_BEARER_TOKEN }}
DATA_DIR: ${{ github.workspace }}/workspace/data/cereal-cs/static
run: dotnet run --project cereal-cs.csproj
working-directory: scripts/cereal-cs
- name: Commit changes
if: steps.update-data.outputs.updated_data == 'true'
run: |
cd workspace/data/cereal-cs
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
if ! git diff --cached --quiet; then
git commit -m "Update game data: $(date +%Y-%m-%d)"
git push origin cereal/cs
fi
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}