-
Notifications
You must be signed in to change notification settings - Fork 0
244 lines (201 loc) · 6.96 KB
/
actions.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
name: test and release software
on:
push:
branches:
- main
jobs:
build_and_test_windows:
runs-on: windows-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install dependencies
run: |
pip install Pillow requests pyinstaller pyautogui
- name: Build for Windows
run: |
pyinstaller --onefile --noconsole --icon=assets/view_earth.ico --name=Heroes3MapLiker Heroes3MapLiker.py # outputs binary to /dist
- name: Run Windows Tests
run: python tests.py
- name: Package Windows artifacts
run: |
New-Item -ItemType Directory -Force -Path "dist/windows"
Copy-Item -Path "dist/Heroes3MapLiker.exe" -Destination "dist/windows/"
Copy-Item -Path "assets" -Destination "dist/windows/" -Recurse
Copy-Item -Path "README.md" -Destination "dist/windows/"
Compress-Archive -Path "dist/windows/*" -DestinationPath "dist/Heroes3MapLiker-windows.zip"
- name: Upload Windows artifact
uses: actions/upload-artifact@v2
with:
name: windows-zip
path: dist/Heroes3MapLiker-windows.zip
build_and_test_macos:
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install dependencies
run: |
pip install Pillow requests pyinstaller pyautogui
- name: Build for macOS
run: |
pyinstaller --onefile --noconsole --icon=assets/view_earth.ico --name=Heroes3MapLiker Heroes3MapLiker.py # outputs binary to /dist
chmod -R +rwx dist
ls -l dist
- name: Run macOS Tests
run: python tests.py
- name: Package macOS artifacts
run: |
mkdir -p dist/macos
cp dist/Heroes3MapLiker dist/macos/
cp -r assets dist/macos/
cp -r README.md dist/macos/
zip -r dist/Heroes3MapLiker-macos.zip dist/macos/
- name: Upload macOS artifact
uses: actions/upload-artifact@v2
with:
name: macos-zip
path: dist/Heroes3MapLiker-macos.zip
build_and_test_linux:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-tk
pip install Pillow requests pyinstaller pyautogui
- name: Build for Linux
run: |
pyinstaller --onefile --noconsole --icon=assets/view_earth.ico --name=Heroes3MapLiker Heroes3MapLiker.py # outputs binary to /dist
- name: Run Linux Tests
run: python tests.py
- name: Package Linux artifacts
run: |
mkdir -p dist/linux
cp dist/Heroes3MapLiker dist/linux/
cp -r assets dist/linux/
cp -r README.md dist/linux/
zip -r dist/Heroes3MapLiker-linux.zip dist/linux/
- name: Upload Linux artifact
uses: actions/upload-artifact@v2
with:
name: linux-zip
path: dist/Heroes3MapLiker-linux.zip
# build_and_test_android:
# runs-on: ubuntu-latest
# timeout-minutes: 30
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.9'
# - name: Set Up JDK
# uses: actions/setup-java@v3
# with:
# distribution: 'zulu'
# java-version: '17'
# - name: Install dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y python3-tk
# pip install Kivy buildozer Pillow requests pyinstaller pyautogui
# - name: Modify build.spec
# run: |
# # First create .py code with Kivy framework. Fill details in file build.spec for cross-platform/.apk gen with buildozer
# echo "title = Heroes3MapLiker" >> build.spec
# echo "package.name = Heroes3MapLiker" >> build.spec
# echo "source.dir = ./" >> build.spec
# echo "requirements = kivy" >> build.spec
# echo "android.permissions = INTERNET" >> build.spec
# echo "version = 0.1" >> build.spec
# echo "android.sdk = 21" >> build.spec
# echo "p4a.branch = """ >> build.spec
# - name: Build Android APK
# run: |
# buildozer init
# buildozer -v android debug
# - name: Set up Android emulator
# run: |
# adb install bin/Heroes3MapLiker.apk
# - name: Run Android Tests
# run: |
# adb shell am start -n com.example.heroes3mapliker/.MainActivity \
# adb shell input keyevent KEYCODE_HOME \
# adb uninstall com.example.heroes3mapliker
create_release:
needs: [build_and_test_windows, build_and_test_macos, build_and_test_linux]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Download Windows artifact
uses: actions/download-artifact@v2
with:
name: windows-zip
path: ./dist
- name: Download macOS artifact
uses: actions/download-artifact@v2
with:
name: macos-zip
path: ./dist
- name: Download Linux artifact
uses: actions/download-artifact@v2
with:
name: linux-zip
path: ./dist
# - name: Create GitHub Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# with:
# tag_name: v1.0.0
# release_name: Release v1.0.0
# draft: false
# prerelease: false
# - name: Upload Windows Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./dist/Heroes3MapLiker-windows.zip
# asset_name: Heroes3MapLiker-windows.zip
# asset_content_type: application/zip
# - name: Upload macOS Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./dist/Heroes3MapLiker-macos.zip
# asset_name: Heroes3MapLiker-macos.zip
# asset_content_type: application/zip
# - name: Upload Linux Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./dist/Heroes3MapLiker-linux.zip
# asset_name: Heroes3MapLiker-linux.zip
# asset_content_type: application/zip