-
Notifications
You must be signed in to change notification settings - Fork 6
163 lines (142 loc) · 6.11 KB
/
package.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
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
name: Build Package
on:
push:
branches:
- main
- "releases/*"
jobs:
build-rust-libraries:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, ubuntu-arm, macos-latest, macos-arm, windows-latest]
include:
- os: ubuntu-latest
bridge-out-file: libdelta_rs_bridge.so
kernel-out-file: libdelta_kernel_ffi.so
out-prefix: linux-x64
- os: ubuntu-arm
bridge-out-file: libdelta_rs_bridge.so
kernel-out-file: libdelta_kernel_ffi.so
out-prefix: linux-arm64
runsOn: ubuntu-latest
use-cross: true
alternative-target: aarch64-unknown-linux-gnu
- os: macos-latest
bridge-out-file: libdelta_rs_bridge.dylib
kernel-out-file: libdelta_kernel_ffi.dylib
out-prefix: osx-x64
alternative-target: x86_64-apple-darwin
- os: macos-arm
bridge-out-file: libdelta_rs_bridge.dylib
kernel-out-file: libdelta_kernel_ffi.dylib
out-prefix: osx-arm64
runsOn: macos-latest
- os: windows-latest
bridge-out-file: delta_rs_bridge.dll
kernel-out-file: delta_kernel_ffi.dll
out-prefix: win-x64
runs-on: ${{ matrix.runsOn || matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: false
- name: Checkout specific delta-kernel-rs release
shell: bash
run: chmod -R +x .scripts/*.sh && .scripts/checkout-delta-kernel-rs.sh
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup Rust cache
uses: Swatinem/[email protected]
with:
workspaces: src/DeltaLake/Bridge
key: ${{ matrix.os }}
- name: Add alternative Rust target
if: ${{ matrix.alternative-target != ''}}
run: |
rustup target install ${{ matrix.alternative-target }}
- name: Install cross
if: ${{ matrix.use-cross }}
run: |
cargo install cross
# Note: Kernel builds are currently using non-release builds, see .csproj for details
#
- name: Build alternative target
if: ${{ matrix.alternative-target != '' && !matrix.use-cross }}
run: |
cargo build --manifest-path src/DeltaLake/Bridge/Cargo.toml --release --target ${{ matrix.alternative-target }}
cargo build --manifest-path src/DeltaLake/Kernel/delta-kernel-rs/ffi/Cargo.toml --features "delta_kernel/cloud" --target ${{ matrix.alternative-target }}
- name: Build cross target
if: ${{ matrix.use-cross }}
run: |
cross build --manifest-path src/DeltaLake/Bridge/Cargo.toml --release --target ${{ matrix.alternative-target }}
CROSS_CONFIG=src/DeltaLake/Kernel/Build/cross/${{ matrix.alternative-target }}/Cross.toml \
cross build --manifest-path src/DeltaLake/Kernel/delta-kernel-rs/ffi/Cargo.toml \
--features "delta_kernel/cloud" \
--target ${{ matrix.alternative-target }}
- name: Build Bridge
if: ${{ !matrix.alternative-target }}
run: cargo build --manifest-path src/DeltaLake/Bridge/Cargo.toml --release
- name: Build Kernel
if: ${{ !matrix.alternative-target }}
run: cargo build --manifest-path src/DeltaLake/Kernel/delta-kernel-rs/ffi/Cargo.toml --features "delta_kernel/cloud"
- name: Upload bridge library
if: ${{ !matrix.alternative-target }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.out-prefix }}-bridge
path: src/DeltaLake/Bridge/target/release/${{ matrix.bridge-out-file }}
- name: Upload kernel library
if: ${{ !matrix.alternative-target }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.out-prefix }}-kernel
path: src/DeltaLake/Kernel/delta-kernel-rs/target/debug/${{ matrix.kernel-out-file }}
- name: Upload bridge library alternative target
if: ${{ matrix.alternative-target != '' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.out-prefix }}-bridge
path: src/DeltaLake/Bridge/target/${{ matrix.alternative-target }}/release/${{ matrix.bridge-out-file }}
if-no-files-found: "error"
- name: Upload kernel library alternative target
if: ${{ matrix.alternative-target != '' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.out-prefix }}-kernel
path: src/DeltaLake/Kernel/delta-kernel-rs/target/${{ matrix.alternative-target }}/debug/${{ matrix.kernel-out-file }}
if-no-files-found: "error"
build-nuget-package:
needs:
- build-rust-libraries
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: false
- name: Checkout specific delta-kernel-rs release
shell: bash
run: chmod -R +x .scripts/*.sh && .scripts/checkout-delta-kernel-rs.sh
- name: Download rust libraries
uses: actions/download-artifact@v4
with:
path: rust-libraries
- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: Build package
run: dotnet pack src/DeltaLake/DeltaLake.csproj -c Release /p:RustLibraryRoot=${{ github.workspace }}/rust-libraries
- name: Upload NuGet artifact
uses: actions/upload-artifact@v4
with:
name: nuget-package
path: |
src/DeltaLake/bin/Release/*.nupkg
src/DeltaLake/bin/Release/*.snupkg
- name: Push nuget artifacts
run: |
dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/delta-incubator/index.json"
dotnet nuget push .\src\DeltaLake\bin\Release\DeltaLake.Net.*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "github" --skip-duplicate