-
Notifications
You must be signed in to change notification settings - Fork 5
133 lines (130 loc) · 4.35 KB
/
allInOne.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
name: Build and Publish for all Platforms
on: [push]
env:
SWIG_VERSION: 4.0.2
jobs:
validate-gradle-wrapper:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2
swig:
strategy:
matrix:
os: [ubuntu-20.04, macos-12, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: SWIG from cache
id: cache-swig
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/swig
key: ${{ runner.os }}-${{ runner.arch }}-swig-${{ env.SWIG_VERSION }}
- name: Install SWIG build dependencies
if: steps.cache-swig.outputs.cache-hit != 'true'
run: |
if [ "${{ runner.os }}" == 'Linux' ]; then
sudo apt-get install -y autoconf automake libtool
elif [ "${{ runner.os }}" == 'macOS' ]; then
brew install autoconf automake libtool pcre
else
echo "Unsupported OS: ${{ runner.os }}"
exit 1
fi
- name: Build SWIG v${{ env.SWIG_VERSION }}
if: steps.cache-swig.outputs.cache-hit != 'true'
run: |
wget https://github.com/swig/swig/archive/refs/tags/v${{ env.SWIG_VERSION }}.tar.gz
tar xzf v${{ env.SWIG_VERSION }}.tar.gz
cd swig-${{ env.SWIG_VERSION }}
./autogen.sh
./configure --prefix=$GITHUB_WORKSPACE/swig
make
make install
- name: Install SWIG runtime dependencies
if: runner.os == 'macOs'
run: |
brew install pcre
- name: Check SWIG version
run: $GITHUB_WORKSPACE/swig/bin/swig -version
build:
strategy:
matrix:
os: [ubuntu-20.04, macos-12, macos-14]
runs-on: ${{ matrix.os }}
needs: [validate-gradle-wrapper, swig]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Restore SWIG from cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/swig
key: ${{ runner.os }}-${{ runner.arch }}-swig-${{ env.SWIG_VERSION }}
fail-on-cache-miss: true
- name: Add SWIG to $PATH
run: echo "${{ github.workspace }}/swig/bin" >> $GITHUB_PATH
- name: Install MinGW-w64
if: runner.os == 'Linux'
run: sudo apt-get install -y mingw-w64
- name: Install pcre
if: runner.os == 'macOS'
run: brew install pcre
- name: Check SWIG version
run: swig -version
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew build buildNatives
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-${{ runner.arch }}-artifacts
path: |
build/natives/*/*.so
build/natives/*/*.dll
build/natives/*/*.dylib
publish:
runs-on: ubuntu-20.04
needs: [validate-gradle-wrapper, swig, build]
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Restore SWIG from cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/swig
key: ${{ runner.os }}-${{ runner.arch }}-swig-${{ env.SWIG_VERSION }}
fail-on-cache-miss: true
- name: Add SWIG to $PATH
run: echo "${{ github.workspace }}/swig/bin" >> $GITHUB_PATH
- name: Check SWIG version
run: swig -version
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: build/natives
merge-multiple: true
- name: Build and Zip Natives
run: ./gradlew build zipNatives
- name: Publish
run: ./gradlew -Dorg.gradle.internal.publish.checksums.insecure=true publish -PmavenUser=${artifactoryUser} -PmavenPass=${artifactoryPass}
env:
artifactoryUser: ${{ secrets.ARTIFACTORY_USER }}
artifactoryPass: ${{ secrets.ARTIFACTORY_PASS }}