Skip to content

Commit

Permalink
General improvements (#10)
Browse files Browse the repository at this point in the history
* Improve csproj configuration

* Pipeline improvements

* does this break the pipeline?

* Broke the wrong thing

* Revert "does this break the pipeline?"

* use latest setup-dotnet action
  • Loading branch information
tvandinther authored Oct 24, 2023
1 parent e6c685b commit 3e4b291
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Cache Rust Bindings
id: cache-rust-bindings
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
rust-bindings/target/release/*csharp_bindings.*
Expand All @@ -34,7 +34,7 @@ jobs:
shell: bash

- name: Upload bindings
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: bindings
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
needs: build-dependencies
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Assert tag matches project version
run: |
Expand All @@ -29,7 +29,7 @@ jobs:
path: rust-bindings

- name: Setup dotnet
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"

Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,31 @@ jobs:

test:
name: Test
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
needs: build-dependencies
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Download bindings
uses: actions/download-artifact@v3
with:
name: bindings
path: rust-bindings

- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v1.7.2
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore -p:MultiPlatformBuild=True
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test --no-restore --verbosity normal
8 changes: 4 additions & 4 deletions Libsql.Client/Libsql.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Title>Libsql.Client</Title>
<Authors>Tom van Dinther</Authors>
<Description>A client library for Libsql</Description>
<Description>A client library for Libsql.</Description>
<PackageVersion>0.2.3</PackageVersion>
<Copyright>Copyright (c) Tom van Dinther 2023</Copyright>
<PackageProjectUrl>https://github.com/tvandinther/libsql-client-dotnet</PackageProjectUrl>
Expand Down Expand Up @@ -34,15 +34,15 @@
</PropertyGroup>

<ItemGroup>
<Content Include="$(NativeOutputPath)libcsharp_bindings.so">
<Content Condition="'$(MultiPlatformBuild)' Or '$([MSBuild]::IsOsPlatform(Linux))'" Include="$(NativeOutputPath)libcsharp_bindings.so">
<PackagePath>runtimes/linux-x64/native/libcsharp_bindings.so</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Condition="'$(MultiPlatformBuild)' == 'True'" Include="$(NativeOutputPath)csharp_bindings.dll">
<Content Condition="'$(MultiPlatformBuild)' Or '$([MSBuild]::IsOsPlatform(Windows))'" Include="$(NativeOutputPath)csharp_bindings.dll">
<PackagePath>runtimes/win-x64/native/csharp_bindings.dll</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Condition="'$(MultiPlatformBuild)' == 'True'" Include="$(NativeOutputPath)libcsharp_bindings.dylib">
<Content Condition="'$(MultiPlatformBuild)' Or '$([MSBuild]::IsOsPlatform(macOS))'" Include="$(NativeOutputPath)libcsharp_bindings.dylib">
<PackagePath>runtimes/osx-x64/native/libcsharp_bindings.dylib</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down

0 comments on commit 3e4b291

Please sign in to comment.