-
Notifications
You must be signed in to change notification settings - Fork 3
160 lines (132 loc) · 4.14 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
name: Build v-hacd bindings
on:
push:
branches:
pull_request:
release:
types: [published]
jobs:
BuildMac:
name: Build vhacd for mac
runs-on: macos-latest
steps:
- name: Clone the repo
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Build
run: |
./make.sh buildMac
./build/tests/base.darwin
mkdir -p deploy/
tar -C build/lib/ -czf deploy/libs-mac.tar.gz .
tar -C build/tests/ -czf deploy/tests-mac.tar.gz .
- name: Upload libs
uses: actions/upload-artifact@v2
with:
name: libs-mac
path: deploy/libs-mac.tar.gz
- name: Upload tests
uses: actions/upload-artifact@v2
with:
name: tests-mac
path: deploy/tests-mac.tar.gz
BuildLinuxWindows:
name: Build vhacd for linux and Windows
runs-on: ubuntu-latest
container:
image: riccardoblb/buildenvs:javacross
steps:
- name: Clone the repo
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Prepare
run: apt-get install -y g++-multilib
- name: Build
run: |
./make.sh buildLinux32
./make.sh buildLinux64
./make.sh buildWindows32
./make.sh buildWindows64
./build/tests/base.linux.x86-64
mkdir -p deploy/
tar -C build/lib/ -czf deploy/libs-winLinux.tar.gz .
tar -C build/tests/ -czf deploy/tests-winLinux.tar.gz .
- name: Upload libs
uses: actions/upload-artifact@v2
with:
name: libs-winLinux
path: deploy/libs-winLinux.tar.gz
- name: Upload tests
uses: actions/upload-artifact@v2
with:
name: tests-winLinux
path: deploy/tests-winLinux.tar.gz
Release:
name: Build release
needs: [BuildLinuxWindows,BuildMac]
runs-on: ubuntu-latest
steps:
- name: Clone the repo
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Prepare java
uses: actions/setup-java@v1
with:
java-version: '8' # The JDK version to make available on the path.
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64
- name: Download linux and windows libs
uses: actions/[email protected]
with:
name: libs-winLinux
path: deploy/
- name: Download mac libs
uses: actions/[email protected]
with:
name: libs-mac
path: deploy/
- name: Build java binds
run: |
mkdir -p build/lib/
tar -xzf deploy/libs-winLinux.tar.gz -C build/lib/
tar -xzf deploy/libs-mac.tar.gz -C build/lib/
./make.sh buildJavaBindings
`which java` -cp ./build/tests/base.jar Main
- name: Upload release
uses: actions/upload-artifact@v2
with:
name: release
path: build/release
Deploy:
name: Deploy
needs: [Release]
runs-on: ubuntu-latest
steps:
- name: Clone the repo
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Download release
uses: actions/[email protected]
with:
name: release
path: build/release
- name: Deploy to github registry
if: github.event_name == 'release'
run: |
source make.sh
mkdir -p deploy/vhacd/vhacd-native/$VERSION
mv build/release/* deploy/vhacd/vhacd-native/$VERSION
cd deploy/
set -e
files="`find . \( -name "*.jar" -o -name "*.pom" \) -type f -print`"
set -f
for art in $files; do
file="${art:2}"
dest="https://maven.pkg.github.com/$GITHUB_REPOSITORY/$file"
echo "Upload $file to $dest"
curl -X PUT $dest -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" --upload-file $file -vvv
done