Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit f81a59e

Browse files
committed
Attempt to build shared libs dynamically
1 parent 45628a5 commit f81a59e

File tree

2 files changed

+139
-29
lines changed

2 files changed

+139
-29
lines changed

.github/workflows/gh-mvn-2.yml

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Build Shared Libraries
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- kendall/github-mvn-repo
8+
pull_request:
9+
10+
jobs:
11+
build_aarch64_apple_darwin:
12+
runs-on: macos-latest
13+
name: Build aarch64-apple-darwin target
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Install Rust
17+
run: rustup toolchain install stable
18+
- name: Run Build Script
19+
run: |
20+
cd bindings/tbdex_uniffi/libtargets/aarch64-apple-darwin
21+
./build
22+
- name: Upload .dylib
23+
uses: actions/upload-artifact@v3
24+
with:
25+
name: aarch64-apple-darwin-dylib
26+
path: bound/kt/src/main/resources/libtbdex_uniffi_aarch64_apple_darwin.dylib
27+
28+
build_x86_64_apple_darwin:
29+
runs-on: macos-latest
30+
name: Build x86_64-apple-darwin target
31+
steps:
32+
- uses: actions/checkout@v2
33+
- name: Install Rust
34+
run: rustup toolchain install stable
35+
- name: Run Build Script
36+
run: |
37+
cd bindings/tbdex_uniffi/libtargets/x86_64-apple-darwin
38+
./build
39+
- name: Upload .dylib
40+
uses: actions/upload-artifact@v3
41+
with:
42+
name: x86_64-apple-darwin-dylib
43+
path: bound/kt/src/main/resources/libtbdex_uniffi_x86_64_apple_darwin.dylib
44+
45+
build_x86_64_unknown_linux_gnu:
46+
runs-on: ubuntu-latest
47+
name: Build x86_64-unknown-linux-gnu target
48+
steps:
49+
- uses: actions/checkout@v2
50+
- name: Run Build Script
51+
run: |
52+
cd bindings/tbdex_uniffi/libtargets/x86_64-unknown-linux-gnu
53+
./build
54+
- name: Upload .so
55+
uses: actions/upload-artifact@v3
56+
with:
57+
name: x86_64-unknown-linux-gnu-so
58+
path: bound/kt/src/main/resources/libtbdex_uniffi_x86_64_unknown_linux_gnu.so
59+
60+
build_x86_64_unknown_linux_musl:
61+
runs-on: ubuntu-latest
62+
name: Build x86_64-unknown-linux-musl target
63+
steps:
64+
- uses: actions/checkout@v2
65+
- name: Run Build Script
66+
run: |
67+
cd bindings/tbdex_uniffi/libtargets/x86_64-unknown-linux-musl
68+
./build
69+
- name: Upload .so
70+
uses: actions/upload-artifact@v3
71+
with:
72+
name: x86_64-unknown-linux-musl-so
73+
path: bound/kt/src/main/resources/libtbdex_uniffi_x86_64_unknown_linux_musl.so
74+
75+
test_shared_libraries:
76+
runs-on: ubuntu-latest
77+
needs:
78+
- build_aarch64_apple_darwin
79+
- build_x86_64_apple_darwin
80+
- build_x86_64_unknown_linux_gnu
81+
- build_x86_64_unknown_linux_musl
82+
strategy:
83+
matrix:
84+
target:
85+
[
86+
aarch64_apple_darwin,
87+
x86_64_apple_darwin,
88+
x86_64_unknown_linux_gnu,
89+
x86_64_unknown_linux_musl,
90+
]
91+
name: Test on ${{ matrix.target }}
92+
steps:
93+
- uses: actions/checkout@v2
94+
- name: Download binaries
95+
uses: actions/download-artifact@v3
96+
with:
97+
name: ${{ matrix.target }}-dylib
98+
path: bound/kt/src/main/resources/
99+
- name: Set up JDK 11
100+
uses: actions/setup-java@v3
101+
with:
102+
distribution: "adopt"
103+
java-version: "11"
104+
- name: Run tests
105+
run: |
106+
cd bound/kt
107+
mvn '-Dtest=SystemArchitectureTest#can load shared library' test

.github/workflows/gh-mvn.yml

+32-29
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,38 @@ jobs:
1111
runs-on: macos-latest
1212

1313
steps:
14-
- name: Checkout repository
15-
uses: actions/checkout@v3
16-
with:
17-
submodules: true # Checkout submodules
18-
fetch-depth: 0 # Fetch all history for all branches and tags
14+
- name: Temporary commented out
15+
run: echo "hello world"
1916

20-
- name: Set up Java
21-
uses: actions/setup-java@v3
22-
with:
23-
# distribution: 'temurin'
24-
# java-version: '17' # Adjust the Java version as needed
25-
distribution: 'adopt'
26-
java-version: '11'
17+
# - name: Checkout repository
18+
# uses: actions/checkout@v3
19+
# with:
20+
# submodules: true # Checkout submodules
21+
# fetch-depth: 0 # Fetch all history for all branches and tags
2722

28-
- name: Set up Maven settings
29-
run: |
30-
mkdir -p ~/.m2
31-
echo "<settings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd\">
32-
<servers>
33-
<server>
34-
<id>github</id>
35-
<username>${{ github.actor }}</username>
36-
<password>${{ secrets.GITHUB_TOKEN }}</password>
37-
</server>
38-
</servers>
39-
</settings>" > ~/.m2/settings.xml
23+
# - name: Set up Java
24+
# uses: actions/setup-java@v3
25+
# with:
26+
# # distribution: 'temurin'
27+
# # java-version: '17' # Adjust the Java version as needed
28+
# distribution: 'adopt'
29+
# java-version: '11'
4030

41-
- name: Build and deploy
42-
run: |
43-
cd bound/kt
44-
mvn '-Dtest=SystemArchitectureTest#can load shared library' test
45-
mvn deploy
31+
# - name: Set up Maven settings
32+
# run: |
33+
# mkdir -p ~/.m2
34+
# echo "<settings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd\">
35+
# <servers>
36+
# <server>
37+
# <id>github</id>
38+
# <username>${{ github.actor }}</username>
39+
# <password>${{ secrets.GITHUB_TOKEN }}</password>
40+
# </server>
41+
# </servers>
42+
# </settings>" > ~/.m2/settings.xml
43+
44+
# - name: Build and deploy
45+
# run: |
46+
# cd bound/kt
47+
# mvn '-Dtest=SystemArchitectureTest#can load shared library' test
48+
# mvn deploy

0 commit comments

Comments
 (0)