-
Notifications
You must be signed in to change notification settings - Fork 24
164 lines (141 loc) · 5.39 KB
/
main.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
name: Testing
on:
push:
branches: main
paths-ignore:
- '.github/workflows/format.yml'
- '.github/workflows/libs-building.yml'
- '.github/workflows/pages.yml'
- 'docs/**'
- 'project/vlc/scripts/**'
- 'LICENSE'
- 'README.md'
- 'TODO.md'
- 'haxelib.json'
- 'hxformat.json'
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Desktop:
runs-on: ${{matrix.os}}-latest
strategy:
fail-fast: false
matrix:
os: [windows, macos, ubuntu]
sample: [flixel, openfl]
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup Haxe
uses: krdlab/setup-haxe@master
with:
haxe-version: 4.3.6
- name: Install Dependencies
if: matrix.os == 'ubuntu'
run: sudo apt-get update && sudo apt-get install libvlc-dev libvlccore-dev vlc-bin vlc
- name: Install Haxe Libraries
run: |
haxelib install lime --quiet --never --skip-dependencies
haxelib install openfl --quiet --never --skip-dependencies
haxelib dev hxvlc .
- name: Setup Flixel Libraries
if: matrix.sample == 'flixel'
run: |
haxelib install flixel --quiet --never --skip-dependencies
haxelib install hscript --quiet --never --skip-dependencies
- name: Setup hxcpp Library
run: haxelib git hxcpp https://github.com/HaxeFoundation/hxcpp.git --quiet --never --skip-dependencies && haxelib run lime rebuild hxcpp
- name: List Installed Haxe Libraries
run: haxelib list
- name: Build Windows
if: matrix.os == 'windows'
run: cd samples/${{matrix.sample}} && haxelib run lime build windows
- name: Upload Windows Artifact
if: matrix.os == 'windows'
uses: actions/upload-artifact@main
with:
name: windowsBuild-${{matrix.sample}}
path: samples/${{matrix.sample}}/export/windows/bin
if-no-files-found: warn
- name: Build MacOS
if: matrix.os == 'macos'
run: cd samples/${{matrix.sample}} && haxelib run lime build mac && tar -zcf build.tar.gz -C export/macos/bin .
- name: Upload MacOS Artifact
if: matrix.os == 'macos'
uses: actions/upload-artifact@main
with:
name: macBuild-${{matrix.sample}}
path: samples/${{matrix.sample}}/build.tar.gz
if-no-files-found: warn
- name: Build Linux
if: matrix.os == 'ubuntu'
run: cd samples/${{matrix.sample}} && haxelib run lime build linux && tar -zcf build.tar.gz -C export/linux/bin .
- name: Upload Linux Artifact
if: matrix.os == 'ubuntu'
uses: actions/upload-artifact@main
with:
name: linuxBuild-${{matrix.sample}}
path: samples/${{matrix.sample}}/build.tar.gz
if-no-files-found: warn
Mobile:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
os: [android, ios]
sample: [flixel, openfl]
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup Haxe
uses: krdlab/setup-haxe@master
with:
haxe-version: 4.3.6
- name: Install Haxe Libraries
run: |
haxelib install lime --quiet --never --skip-dependencies
haxelib install openfl --quiet --never --skip-dependencies
haxelib install extension-androidtools --quiet --never --skip-dependencies
haxelib dev hxvlc .
- name: Setup Flixel Libraries
if: matrix.sample == 'flixel'
run: |
haxelib install flixel --quiet --never --skip-dependencies
haxelib install hscript --quiet --never --skip-dependencies
- name: Setup hxcpp Library
run: haxelib git hxcpp https://github.com/HaxeFoundation/hxcpp.git --quiet --never --skip-dependencies && haxelib run lime rebuild hxcpp
- name: List Installed Haxe Libraries
run: haxelib list
- name: Configure Android Environment
if: matrix.os == 'android'
run: |
haxelib run lime config ANDROID_SDK $ANDROID_HOME
haxelib run lime config ANDROID_NDK_ROOT $ANDROID_NDK_LATEST_HOME
haxelib run lime config JAVA_HOME $JAVA_HOME_11_arm64
haxelib run lime config ANDROID_SETUP true
- name: Build Android
if: matrix.os == 'android'
run: cd samples/${{matrix.sample}} && haxelib run lime build android
- name: Upload Android Artifact
if: matrix.os == 'android'
uses: actions/upload-artifact@main
with:
name: androidBuild-${{matrix.sample}}
path: samples/${{matrix.sample}}/export/android/bin/app/build/outputs/apk/debug
if-no-files-found: warn
- name: Build iOS
if: matrix.os == 'ios'
run: cd samples/${{matrix.sample}} && haxelib run lime build ios -nosign
- name: Create iOS IPA
if: matrix.os == 'ios'
run: cd samples/${{matrix.sample}}/export/ios/build/Release-iphoneos && mkdir Payload && mv *.app Payload && zip -r Sample.ipa Payload
- name: Upload iOS Artifact
if: matrix.os == 'ios'
uses: actions/upload-artifact@main
with:
name: iOSBuild-${{matrix.sample}}
path: samples/${{matrix.sample}}/export/ios/build/Release-iphoneos/Sample.ipa
if-no-files-found: warn