-
Notifications
You must be signed in to change notification settings - Fork 13
203 lines (165 loc) · 4.68 KB
/
workflow.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: Workflow
on:
workflow_dispatch:
repository_dispatch:
jobs:
Job_U:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install -g cytrus-v6
- name: U1 - Update Dofus Client
run: |
cytrus-v6 download --game dofus --select "DofusInvoker.swf,**/*.d2i,**/*.d2o,VERSION" --output data/U/
- name: Upload files
uses: actions/upload-artifact@v3
with:
name: Job_U
path: |
data/U/
Job_A:
runs-on: ubuntu-latest
needs: [Job_U]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: Job_U
path: data/U/
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: A1 - Extract DofusInvoker.swf
run: |
chmod +x src/A1.sh
src/A1.sh data/U/DofusInvoker.swf data/A/DofusInvoker/
- name: A2 - Build .json
run: |
python src/A2.py data/A/DofusInvoker/scripts/com/ data/A/events.json
- name: A3 - Build .properties
run: |
python src/A3.py data/A/events.json data/A/events.properties
- name: Upload files
uses: actions/upload-artifact@v3
with:
name: Job_A
path: |
data/A/
Job_B:
runs-on: ubuntu-latest
needs: [Job_U]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: Job_U
path: data/U/
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: B1 - Build .json
run: |
python src/B1.py data/U/data/common/ data/B/entities_json/
- name: Upload files
uses: actions/upload-artifact@v3
with:
name: Job_B
path: |
data/B/
Job_C:
runs-on: ubuntu-latest
needs: [Job_U]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: Job_U
path: data/U/
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: C1 - Build .json
run: |
python src/C1.py data/U/data/i18n/ data/C/translations_json/
- name: Upload files
uses: actions/upload-artifact@v3
with:
name: Job_C
path: |
data/C/
Job_P:
runs-on: ubuntu-latest
needs: [Job_A, Job_B, Job_C]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Download files Job U
uses: actions/download-artifact@v3
with:
name: Job_U
path: data/U/
- name: Download files Job A
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: Job_A
path: data/A/
- name: Download files Job B
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: Job_B
path: data/B/
- name: Download files Job C
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: Job_C
path: data/C/
- name: Get latest Dofus version
run: |
export DOFUS_VERSION=$(cat data/U/VERSION)
echo The current Dofus version is $DOFUS_VERSION
echo "::set-env name=VERSION::$DOFUS_VERSION"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
- name: Commit and push
uses: EndBug/add-and-commit@v9
with:
add: '["data/A/", "data/B/", "data/C/"]'
message: 'Update ${{ env.VERSION }}'
push: true
- name: Create zip file
run: |
zip -r data.zip data/A/ data/B/ data/C/
- name: Publish release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ env.VERSION }}
prerelease: false
title: ${{ env.VERSION }}
files: |
./data.zip