Skip to content

Commit 413d74a

Browse files
Migrate to GitHub Actions
1 parent 15eb330 commit 413d74a

File tree

6 files changed

+295
-402
lines changed

6 files changed

+295
-402
lines changed
Lines changed: 295 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,295 @@
1+
name: TileDB-Java
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
branches:
8+
- 'master'
9+
pull_request:
10+
11+
jobs:
12+
Test_Windows:
13+
runs-on: windows-2019
14+
steps:
15+
- name: checkout
16+
uses: actions/checkout@v2
17+
18+
- name: checkFormat
19+
uses: gradle/gradle-build-action@v1
20+
with:
21+
arguments: checkFormat
22+
23+
- name: assemble
24+
uses: gradle/gradle-build-action@v1
25+
with:
26+
arguments: assemble
27+
28+
- name: test
29+
uses: gradle/gradle-build-action@v1
30+
with:
31+
arguments: test
32+
env:
33+
ORG_GRADLE_PROJECT_TILEDB_SERIALIZATION: OFF
34+
ORG_GRADLE_PROJECT_TILEDB_S3: OFF
35+
36+
37+
Test_Ubuntu_macOS:
38+
runs-on: ${{ matrix.os }}
39+
strategy:
40+
matrix:
41+
os: [ ubuntu-18.04, macos-10.15 ]
42+
43+
steps:
44+
- name: checkout
45+
uses: actions/checkout@v2
46+
47+
- run: |
48+
unset SYSTEM
49+
./gradlew checkFormat
50+
shell: bash
51+
name: checkFormat
52+
53+
- run: |
54+
unset SYSTEM
55+
./gradlew assemble
56+
shell: bash
57+
name: assemble
58+
59+
- run: |
60+
unset SYSTEM
61+
./gradlew test
62+
shell: bash
63+
name: test
64+
65+
- run: |
66+
set -e pipefail
67+
# Display log files if the build failed
68+
echo "Dumping log files for failed build"
69+
echo "----------------------------------"
70+
for f in $(find $BUILD_REPOSITORY_LOCALPATH -name *.dumpstream);
71+
do echo "------"
72+
echo $f
73+
echo "======"
74+
cat $f
75+
done;
76+
shell: bash
77+
name: error_print
78+
if: ${{ failure() }}
79+
80+
env:
81+
ORG_GRADLE_PROJECT_TILEDB_SERIALIZATION: OFF
82+
ORG_GRADLE_PROJECT_TILEDB_S3: OFF
83+
84+
Create_Artifacts_Windows:
85+
if: startsWith(github.ref, 'refs/tags/')
86+
needs: [Test_Windows]
87+
name: Create_Artifacts_Windows
88+
runs-on: windows-latest
89+
steps:
90+
- name: checkout
91+
uses: actions/checkout@v2
92+
93+
- run: |
94+
mkdir binaries_Windows
95+
./gradlew.bat assemble
96+
Copy-Item ./build/tiledb_jni/Release/*.dll -Destination ./binaries_Windows/
97+
Copy-Item ./build/install/bin/*.dll -Destination ./binaries_Windows/
98+
name: Assemble
99+
100+
- run: |
101+
set -e pipefail
102+
# Display log files if the build failed
103+
echo "Dumping log files for failed build"
104+
echo "----------------------------------"
105+
for f in $(find $BUILD_REPOSITORY_LOCALPATH -name *.log);
106+
do echo "------"
107+
echo $f
108+
echo "======"
109+
cat $f
110+
done;
111+
if: ${{ failure() }}
112+
name: "Print log files (failed build only)"
113+
114+
- name: Archive files
115+
uses: master-atul/tar-action@v1.0.2
116+
id: compress
117+
with:
118+
command: c
119+
cwd: ./
120+
files: |
121+
./binaries_Windows
122+
outPath: tiledb-Win.gz.tar
123+
124+
- uses: actions/upload-artifact@v2
125+
with:
126+
name: Upload-Artifact-Windows
127+
path: tiledb-Win.gz.tar
128+
env:
129+
ORG_GRADLE_PROJECT_TILEDB_S3: ON
130+
131+
Create_Artifacts_Ubuntu_MacOS:
132+
if: startsWith(github.ref, 'refs/tags/')
133+
needs: [Test_Ubuntu_macOS]
134+
name: Create_Artifacts_Ubuntu_MacOS
135+
runs-on: ${{ matrix.os }}
136+
strategy:
137+
matrix:
138+
os: [ macos-10.15, ubuntu-latest ]
139+
steps:
140+
- name: checkout
141+
uses: actions/checkout@v2
142+
143+
- run: |
144+
set +e
145+
146+
mkdir binaries_$RUNNER_OS
147+
148+
if [[ ( "$RUNNER_OS" == "Linux" ) ]]; then
149+
docker build -f ci/Dockerfile2010 . -t lib_builder_2010
150+
docker run -e "CFLAGS=$CFLAGS" -e "CPPFLAGS=$CPPFLAGS" -v $(pwd):/TileDB-Java -t lib_builder_2010 /TileDB-Java/ci/build.sh
151+
cp ./build/tiledb_jni/*.so ./build/install/lib/*.so ./build/install/lib64/*.so binaries_$RUNNER_OS/
152+
fi
153+
154+
if [[ ( "$RUNNER_OS" == "macOS" ) ]]; then
155+
./gradlew -PTILEDB_AZURE=ON assemble
156+
cp ./build/tiledb_jni/*.dylib ./build/install/lib/*.dylib binaries_$RUNNER_OS/
157+
fi
158+
159+
name: 'Build and Upload (Ubuntu and OSX)'
160+
161+
- run: |
162+
set -e pipefail
163+
# Display log files if the build failed
164+
echo "Dumping log files for failed build"
165+
echo "----------------------------------"
166+
for f in $(find $BUILD_REPOSITORY_LOCALPATH -name *.log);
167+
do echo "------"
168+
echo $f
169+
echo "======"
170+
cat $f
171+
done;
172+
if: ${{ failure() }}
173+
name: "Print log files (failed build only)"
174+
175+
- run: |
176+
tar cvf tiledb-$RUNNER_OS.gz.tar binaries_$RUNNER_OS/
177+
name: Archive_files
178+
179+
- uses: actions/upload-artifact@v2
180+
with:
181+
name: Upload-Artifact-Linux
182+
path: '*.gz.tar'
183+
if: runner.os == 'Linux'
184+
185+
- uses: actions/upload-artifact@v2
186+
with:
187+
name: Upload-Artifact-Mac
188+
path: '*.gz.tar'
189+
if: runner.os == 'macOS'
190+
env:
191+
ORG_GRADLE_PROJECT_TILEDB_SERIALIZATION: ON
192+
ORG_GRADLE_PROJECT_TILEDB_S3: ON
193+
194+
Release:
195+
if: startsWith(github.ref, 'refs/tags/')
196+
needs: [Create_Artifacts_Ubuntu_MacOS, Create_Artifacts_Windows]
197+
name: Create-Release
198+
runs-on: ubuntu-latest
199+
steps:
200+
201+
- name: Checkout
202+
uses: actions/checkout@v2
203+
204+
- name: Set-up Java
205+
uses: actions/setup-java@v2
206+
with:
207+
distribution: 'adopt'
208+
java-version: '11'
209+
check-latest: true
210+
211+
- uses: actions/download-artifact@v2
212+
213+
- name: Create-Jars
214+
run: |
215+
set +e
216+
217+
mv Upload-*/* .
218+
219+
mkdir -p ./build/install/lib
220+
mkdir ./build/install/lib64
221+
mkdir ./build/tiledb_jni/
222+
mkdir ./build/tiledb_jni/Release
223+
mkdir ./build/install/bin
224+
225+
226+
for arch in $(ls | grep .gz.tar)
227+
do
228+
tar -xvf $arch
229+
done
230+
231+
mv binaries_*/* .
232+
233+
# OSX
234+
mv libtiledb.dylib ./build/install/lib
235+
mv libtiledbjni.dylib ./build/tiledb_jni
236+
237+
# Linux
238+
cp libtiledb.so ./build/install/lib
239+
mv libtiledb.so ./build/install/lib64
240+
mv libtiledbjni.so ./build/tiledb_jni
241+
242+
# Windows
243+
mv tbb.dll ./build/install/bin
244+
mv tiledb.dll ./build/install/bin
245+
mv tiledbjni.dll ./build/tiledb_jni/Release
246+
247+
./gradlew assemble
248+
249+
mkdir jars
250+
cp ./build/libs/*.jar jars
251+
252+
- uses: notlmn/release-with-changelog@v2
253+
name: Build_Changelog
254+
with:
255+
header: 'Changes:'
256+
include-hash: true
257+
token: ${{ secrets.GITHUB_TOKEN }}
258+
259+
- name: Create Release
260+
id: create_release
261+
uses: softprops/action-gh-release@v1
262+
env:
263+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
264+
with:
265+
files: jars/*.jar
266+
tag_name: ${{ github.event.release.tag_name }}
267+
name: ${{ github.event.release.tag_name }}
268+
body: ${{steps.github_release.outputs.changelog}}
269+
draft: false
270+
prerelease: false
271+
env:
272+
ORG_GRADLE_PROJECT_TILEDB_SERIALIZATION: ON
273+
ORG_GRADLE_PROJECT_TILEDB_S3: ON
274+
275+
Maven:
276+
needs: [ Release ]
277+
runs-on: ubuntu-latest
278+
steps:
279+
- uses: actions/checkout@v2
280+
- uses: actions/setup-java@v2
281+
with:
282+
distribution: 'adopt'
283+
java-version: '11'
284+
check-latest: true
285+
- name: Upload to maven
286+
run: |
287+
chmod +x ./ci/upload_to_maven.sh
288+
./ci/upload_to_maven.sh
289+
shell: bash
290+
env:
291+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
292+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
293+
GPG_SECRET_KEYS_ENC: ${{ secrets.GPG_SECRET_KEYS_ENC }}
294+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
295+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

0 commit comments

Comments
 (0)