Repository navigation
186 lines (162 loc) · 5.69 KB
/
Copy pathbindings.yml
File metadata and controls
186 lines (162 loc) · 5.69 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
on:
push:
branches:
- master
pull_request: {}
name: Build bindings
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
target: [aarch64-unknown-linux-gnu]
include:
- os: ubuntu-22.04
target: aarch64-unknown-linux-gnu
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: macos-15
target: aarch64-apple-darwin
- os: macos-15
target: x86_64-apple-darwin
- os: windows-2022
target: x86_64-pc-windows-msvc
- os: windows-2022
target: i686-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- name: Install gcc-aarch64-linux-gnu
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Install NASM
if: matrix.target == 'i686-pc-windows-msvc'
uses: ilammy/setup-nasm@72793074d3c8cdda771dba85f6deafe00623038b # v1.5.2
- name: Checkout
uses: actions/checkout@v6
- run: rm rust-toolchain.toml # otherwise try to use version specified in it
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- run: cargo build --release --target ${{ matrix.target }} -p lwk_bindings
- run: ls -l target/${{ matrix.target }}/release
- name: Archive release windows
uses: actions/upload-artifact@v7
with:
name: bindings-${{ matrix.target }}
path: target/${{ matrix.target }}/release/lwk.dll
if: matrix.os == 'windows-2022'
- name: Archive release linux
uses: actions/upload-artifact@v7
with:
name: bindings-${{ matrix.target }}
path: target/${{ matrix.target }}/release/liblwk.so
if: matrix.os == 'ubuntu-22.04'
- name: Archive release mac
uses: actions/upload-artifact@v7
with:
name: bindings-${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/liblwk.dylib
target/${{ matrix.target }}/release/liblwk.a
if: matrix.os == 'macos-15'
build-cpp:
needs: build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: bindings-x86_64-unknown-linux-gnu
path: target/
- uses: dtolnay/rust-toolchain@stable
- run: |
cargo install --locked uniffi-bindgen-cpp --git https://github.com/NordSecurity/uniffi-bindgen-cpp --tag v0.10.0+v0.31.0
uniffi-bindgen-cpp --library target/liblwk.so --out-dir target
- run: ls -l target
- name: Archive cpp language interface
uses: actions/upload-artifact@v7
with:
name: bindings-interface-cpp
path: target/lwk*
build-csharp:
needs: build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: bindings-x86_64-unknown-linux-gnu
path: target/
- uses: dtolnay/rust-toolchain@stable
- run: |
cargo install --locked uniffi-bindgen-cs --git https://github.com/NordSecurity/uniffi-bindgen-cs --tag v0.11.1+v0.31.0
uniffi-bindgen-cs --library target/liblwk.so --out-dir target
- run: python3 scripts/patch_csharp_finalize.py target/lwk.cs
- run: ls -l target
- name: Archive csharp language interface
uses: actions/upload-artifact@v7
with:
name: bindings-interface-csharp
path: target/lwk.cs
build-nuget:
needs: build-csharp
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: bindings-interface-csharp
path: csharp
- uses: actions/download-artifact@v8
with:
name: bindings-aarch64-apple-darwin
path: csharp/runtimes/osx-arm64/native
- uses: actions/download-artifact@v8
with:
name: bindings-x86_64-apple-darwin
path: csharp/runtimes/osx-x64/native
- uses: actions/download-artifact@v8
with:
name: bindings-aarch64-unknown-linux-gnu
path: csharp/runtimes/linux-arm64/native
- uses: actions/download-artifact@v8
with:
name: bindings-x86_64-unknown-linux-gnu
path: csharp/runtimes/linux-x64/native
- uses: actions/download-artifact@v8
with:
name: bindings-x86_64-pc-windows-msvc
path: csharp/runtimes/win-x64/native
- uses: actions/download-artifact@v8
with:
name: bindings-i686-pc-windows-msvc
path: csharp/runtimes/win-x86/native
- run: cp lwk_bindings/csharp/* csharp
- run: ls -R csharp
- name: Archive the package
uses: actions/upload-artifact@v7
with:
name: LiquidWalletKitPackage
path: csharp/
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
- name: Build the project
working-directory: csharp
run: dotnet build LiquidWalletKit.csproj
- name: Create the package
working-directory: csharp
run: dotnet pack --configuration Release LiquidWalletKit.csproj
- name: Archive the package
uses: actions/upload-artifact@v7
with:
name: LiquidWalletKit.0.8.2.nupkg # TODO make version parametric
path: csharp/bin/Release/*.nupkg