forked from hjenryin/BCJH-Metropolis
-
Notifications
You must be signed in to change notification settings - Fork 491
132 lines (119 loc) · 4.73 KB
/
UpdateEmscripten.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Update Game Data and Recompile wasm
on:
push:
branches:
- "PR"
paths-ignore:
- 'data/**'
- 'build_js/**'
jobs:
update:
continue-on-error: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update Game Data
run: python data/checkUpdate.py
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add data -f
git commit -m "Update Game Data"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
recompile-ems:
runs-on: ubuntu-latest
needs: update
if: ${{ !cancelled() }}
steps:
- uses: mymindstorm/setup-emsdk@v13
with:
version: 3.1.47
- name: version
run: emcc --version
- uses: actions/checkout@v2
- run: git pull
- run: sed -zi 's/\n//g' data/data.min.json
- run: sed -zi 's/ //g' data/data.min.json
- name: Recompile
run: |
cd build_js
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release
emmake make
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add build_js
git commit -m "Recompile Emscripten"
- name: Remove CmakeFiles
run: |
rm -rf build_js/CMakeFiles
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
push-to-Web:
runs-on: ubuntu-latest
needs: recompile-ems
if: ${{ !cancelled() }}
steps:
- uses: actions/checkout@v2
- run: git pull
- name: Deploy to external repository
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.bcjh_web }}
with:
# GitHub Action output files
source-directory: build_js/
destination-github-username: haoyun0
destination-repository-name: BCJH-Metropolis-html
user-email: 41898282+github-actions[bot]@users.noreply.github.com
# It defaults to `main`
target-branch: "test-emscripten"
target-directory: "js/upload"
# Use the same commit message as $ORIGIN_REPOSITORY_URL@commit 's
commit-message: ${{ github.event.head_commit.message }}. (From $ORIGIN_REPOSITORY_URL@commit)
push-to-debug:
runs-on: ubuntu-latest
needs: push-to-Web
# Makes sure that when the debug page is ready, the main page is also ready
if: ${{ !cancelled() }}
steps:
- uses: mymindstorm/setup-emsdk@v13
with:
version: 3.1.56
- name: version
run: emcc --version
- uses: actions/checkout@v2
- run: git pull
- run: sed -zi 's/\n//g' data/data.min.json
- run: sed -zi 's/ //g' data/data.min.json
- name: Recompile
run: |
cd build_js
emcmake cmake .. -DCMAKE_BUILD_TYPE=Debug
emmake make
- name: Remove CmakeFiles
run: |
rm -rf build_js/CMakeFiles
- name: Deploy to external repository
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.bcjh_web }}
with:
# GitHub Action output files
source-directory: build_js/
destination-github-username: haoyun0
destination-repository-name: BCJH-Metropolis-html
user-email: 41898282+github-actions[bot]@users.noreply.github.com
# It defaults to `main`
target-branch: "debug-online"
target-directory: "js/upload"
commit-message: ${{ github.event.head_commit.message }}. (From $ORIGIN_REPOSITORY_URL@commit)