-
Notifications
You must be signed in to change notification settings - Fork 10
104 lines (95 loc) · 2.95 KB
/
ci.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
name: CI
on: [push, workflow_dispatch]
jobs:
build-binaries-unix:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
name: ${{ matrix.os }} build
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install java
uses: actions/setup-java@v1
with:
java-version: 8
- name: Make gradlew executable
run: "chmod +x gradlew"
- name: Build native with gradle
run: "./gradlew -PCI=true opus-jni-native:build"
- name: Prepare artifacts
shell: bash
run: |
mkdir artifacts
for file in $(cat ci/binaries); do # File generated by gradle
echo "Found binary artifact ${file}"
cp "${file}" artifacts
done
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: native-binaries
path: artifacts
build-binaries-windows:
strategy:
fail-fast: false
matrix:
arch: [32bit, 64bit]
name: windows-latest build
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install java
uses: actions/setup-java@v1
with:
java-version: 8
- name: Build native with gradle (Windows)
run: gradlew -PCI=true opus-jni-native:build -P${{ matrix.arch }}
shell: cmd
- name: Prepare artifacts
shell: bash
run: |
mkdir artifacts
for file in $(cat ci/binaries); do # File generated by gradle
echo "Found binary artifact ${file}"
cp "${file}" artifacts
done
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: native-binaries
path: artifacts
build-jar:
needs: [build-binaries-unix, build-binaries-windows]
runs-on: ubuntu-latest # Doesn't matter, but linux tends to be the fastest
name: Build final jar
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install java
uses: actions/setup-java@v1
with:
java-version: 8
- name: Download existing artifacts
uses: actions/download-artifact@v1
with:
name: native-binaries
path: native-binaries
- name: Make gradlew executable
run: "chmod +x gradlew"
- name: Build final jar with gradle
run: "./gradlew -PCI=true -PnativeBinaryExternalDir=native-binaries opus-jni-java:build"
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: Final artifacts
path: opus-jni-java/build/libs/