-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Add pipeline support to bundle Go binaries in NuGet packages #1730
Changes from 4 commits
d5327e3
05422ed
5fa8aa9
7255156
5efd017
b5a29b8
24794fb
d05ec77
511b26f
a08e85c
7eb0114
49ba541
efb3cc8
917880b
a81c487
da55713
beb211f
2297cbe
4731278
6369785
b2422c9
9e42736
d11fa4c
6090391
cb37606
6379951
9f0a554
1ffca8f
6af7491
c8909d8
6f2b4bc
a7fc30f
bb89b65
d43ac0f
0856141
842e129
130d48f
5b22b09
1f80a7f
6ef5b25
8796b6c
bc4a06a
5488fdc
e1a4a63
d721e62
87f21b0
7781109
3221259
e3d1b11
7cdb513
a0c9048
68cbfc3
6990732
c0801c0
23b0b9e
c53a15c
9ca3357
c23046f
7b66e3f
18ae56f
59e92b1
0a8ede6
ffe5f0c
566973f
16c3494
9dbc057
3110b96
122c994
dbdc9c8
49e77dc
2271cb7
b369406
0d0e2a8
a8001e7
2e001f4
fa86a07
91fa282
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -120,11 +120,61 @@ jobs: | |||||
path: | | ||||||
apache-arrow-adbc-${{ steps.version.outputs.VERSION }}.tar.gz | ||||||
|
||||||
go-binaries: | ||||||
name: "Go ${{ matrix.os }}" | ||||||
runs-on: ${{ matrix.os }} | ||||||
needs: | ||||||
- source | ||||||
|
||||||
strategy: | ||||||
matrix: | ||||||
os: [ubuntu-latest, windows-latest, macos-latest] | ||||||
go-version: [1.21.8] # Customize Go versions as needed | ||||||
|
||||||
steps: | ||||||
- uses: actions/download-artifact@v3 | ||||||
with: | ||||||
name: source | ||||||
|
||||||
- name: Extract source archive | ||||||
run: | | ||||||
source_archive=$(echo apache-arrow-adbc-*.tar.gz) | ||||||
VERSION=${source_archive#apache-arrow-adbc-} | ||||||
VERSION=${VERSION%.tar.gz} | ||||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV | ||||||
|
||||||
tar xf apache-arrow-adbc-${VERSION}.tar.gz | ||||||
mv apache-arrow-adbc-${VERSION} adbc | ||||||
|
||||||
- name: Setup Go | ||||||
uses: actions/setup-go@v5 | ||||||
with: | ||||||
go-version: ${{ matrix.go-version }} | ||||||
check-latest: true | ||||||
cache: true | ||||||
cache-dependency-path: adbc/go/adbc/go.sum | ||||||
|
||||||
# run `make -i` because the Windows runs claim they can't delete the .h files, but they are still generated | ||||||
- name: Build Go binaries | ||||||
run: | | ||||||
pushd adbc/go/adbc/pkg | ||||||
make -i | ||||||
popd | ||||||
|
||||||
- name: Upload Go binaries | ||||||
uses: actions/upload-artifact@v3 | ||||||
with: | ||||||
retention-days: 7 | ||||||
path: | | ||||||
adbc/go/adbc/pkg/libadbc_driver_flightsql.* | ||||||
adbc/go/adbc/pkg/libadbc_driver_snowflake.* | ||||||
|
||||||
csharp: | ||||||
name: "C#/.NET" | ||||||
runs-on: ubuntu-latest | ||||||
needs: | ||||||
- source | ||||||
- go-binaries | ||||||
steps: | ||||||
- uses: actions/download-artifact@v3 | ||||||
with: | ||||||
|
@@ -146,6 +196,18 @@ jobs: | |||||
echo "schedule: ${{ github.event.schedule }}" >> $GITHUB_STEP_SUMMARY | ||||||
echo "ref: ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY | ||||||
|
||||||
- uses: actions/download-artifact@v3 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed them to v4 but it was breaking and not downloading the files correctly, so I went back to v3. |
||||||
with: | ||||||
path: adbc/go/adbc/pkg | ||||||
|
||||||
- name: Copy Go binaries | ||||||
run: | | ||||||
pushd adbc/go/adbc/pkg/artifact | ||||||
cp *.dll ../ | ||||||
cp *.so ../ | ||||||
cp *.dylib ../ | ||||||
popd | ||||||
|
||||||
- name: Package | ||||||
run: | | ||||||
pushd adbc/ | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,18 @@ | |
<Exec Command="powershell -ExecutionPolicy Unrestricted -File $(ProjectDir)Build-SnowflakeDriver.ps1" /> | ||
</Target> | ||
|
||
<!-- use copySnowflakeDriver.sh to move all the platform binaries when used in the pipeline --> | ||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent" Condition="$([MSBuild]::IsOSPlatform('Linux'))"> | ||
<Exec Command="bash $(ProjectDir)copySnowflakeDriver.sh" /> | ||
</Target> | ||
|
||
<!-- libadbc_driver_snowflake.dll is listed for each framework because $(TargetFramework) doesn't work here --> | ||
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))"> | ||
<Content Include="readme.md"> | ||
<Pack>true</Pack> | ||
<PackagePath>\</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="libadbc_driver_snowflake.dll"> | ||
<Pack>true</Pack> | ||
<PackagePath>lib\netstandard2.0</PackagePath> | ||
|
@@ -26,13 +36,67 @@ | |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
|
||
<!-- What runs in the pipeline. Assumes the Go builds have happened. --> | ||
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))"> | ||
<Content Include="readme.md"> | ||
<Pack>true</Pack> | ||
<PackagePath>\</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<!-- Windows/DLLs --> | ||
<Content Include="libadbc_driver_snowflake.dll"> | ||
<Pack>true</Pack> | ||
<PackagePath>lib\netstandard2.0</PackagePath> | ||
davidhcoe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="libadbc_driver_snowflake.dll"> | ||
<Pack>true</Pack> | ||
<PackagePath>lib\net472</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="libadbc_driver_snowflake.dll"> | ||
<Pack>true</Pack> | ||
<PackagePath>lib\net6.0</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
|
||
<!-- Linux/so --> | ||
<Content Include="libadbc_driver_snowflake.so"> | ||
<Pack>true</Pack> | ||
<PackagePath>lib\netstandard2.0</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="libadbc_driver_snowflake.so"> | ||
<Pack>true</Pack> | ||
<PackagePath>lib\net472</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="libadbc_driver_snowflake.so"> | ||
<Pack>true</Pack> | ||
<PackagePath>lib\net6.0</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
|
||
<!-- Mac/dylib --> | ||
<Content Include="libadbc_driver_snowflake.dylib"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are Go-built binaries "fat" or would we need separate binaries for x64 and arm64? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You would need separate binaries for x64 and arm64. You can control the build by using |
||
<Pack>true</Pack> | ||
<PackagePath>lib\netstandard2.0</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="libadbc_driver_snowflake.dylib"> | ||
<Pack>true</Pack> | ||
<PackagePath>lib\net472</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="libadbc_driver_snowflake.dylib"> | ||
<Pack>true</Pack> | ||
<PackagePath>lib\net6.0</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\Apache.Arrow.Adbc\Apache.Arrow.Adbc.csproj" /> | ||
</ItemGroup> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
### copies the Snowflake binaries for all platforms to be packaged for NuGet | ||
|
||
echo "Copying the Snowflake ADBC Go drivers" | ||
|
||
location=$(pwd) | ||
|
||
file="libadbc_driver_snowflake.*" | ||
|
||
cd ../../../../../go/adbc/pkg | ||
|
||
pattern="$(pwd)/$file" | ||
|
||
cp $pattern "$location" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed them to v4 but it was breaking and not uploading the files correctly, so I went back to v3.