-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (50 loc) · 1.8 KB
/
Copy pathcereal-cs.yml
File metadata and controls
51 lines (50 loc) · 1.8 KB
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
name: Update C# SDK serialized game data
on:
workflow_dispatch:
schedule:
- cron: '42 5 * * *'
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
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 }}