-
Notifications
You must be signed in to change notification settings - Fork 5
68 lines (58 loc) · 2.55 KB
/
Copy pathasset_sync.yml
File metadata and controls
68 lines (58 loc) · 2.55 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Sync .ink files with Google Drive
on:
schedule:
- cron: '0 */12 * * *'
workflow_dispatch:
jobs:
fetchInkScript:
name: "Fetch .ink files and commit if newer"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.PATDOCSGEN }}
- name: Checkout repository
uses: actions/checkout@v5
- name: Generate current hash of 2-1-FullScene.ink
run: echo "currentHash=$(find unity-ggjj/Assets/Resources/InkDialogueScripts/CaseDemo/2-1-FullScene.ink -type f -exec md5sum {} \; | md5sum)" >> $GITHUB_ENV
- name: Setup node.js
uses: actions/setup-node@v5
with:
node-version-file: 'asset_sync/.nvmrc'
- name: Remove current version of the scene
run: |
rm unity-ggjj/Assets/Resources/InkDialogueScripts/CaseDemo/2-1-FullScene.ink
rm unity-ggjj/Assets/Resources/InkDialogueScripts/CaseDemo/2-1-FullScene.json
- name: Fetch and write Scene from Google Drive using Node.js
run: node asset_sync/fetch_demo.js
shell: bash
- name: Generate new hash of 2-1-FullScene.ink
run: echo "newHash=$(find unity-ggjj/Assets/Resources/InkDialogueScripts/CaseDemo/2-1-FullScene.ink -type f -exec md5sum {} \; | md5sum)" >> $GITHUB_ENV
- name: Print hashes
run: |
echo "Current: '${{ env.currentHash }}'"
echo "New: '${{ env.newHash }}'"
- name: Regenerate .json file
uses: game-ci/unity-builder@v4
env:
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: unity-ggjj/
targetPlatform: ${{ inputs.unityPlatform }}
buildName: 'Game Grumps - Joint Justice'
buildMethod: Editor.Ink.BuildScript.Build
allowDirtyBuild: true
- name: Commit updated .ink and .json
if: env.currentHash != env.newHash
run: |
git config --global user.name github-actions
git config --global user.email 'github-actions@github.com'
git add unity-ggjj/Assets/Resources/InkDialogueScripts/CaseDemo/2-1-FullScene.ink
git add unity-ggjj/Assets/Resources/InkDialogueScripts/CaseDemo/2-1-FullScene.json
time=$(date +"%b %d, %Y %r")
git commit -am "feat(Seductive Reasoning Demo): New version from Google Docs on $time"
git push origin develop --force-with-lease