Skip to content

Commit 758b561

Browse files
committed
Merge branch '2.0' into feat/default-session-saving
# Conflicts: # Core Modules/WalletConnectSharp.Storage/FileSystemStorage.cs
2 parents 2ea8d21 + 4af8225 commit 758b561

File tree

20 files changed

+327
-295
lines changed

20 files changed

+327
-295
lines changed

.github/actions/ci/action.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@ inputs:
1515
runs:
1616
using: "composite"
1717
steps:
18-
# Package buildss
1918
- name: Run tests
2019
if: inputs.type == 'unit-tests'
2120
shell: bash
22-
run: dotnet test --verbosity normal --filter Category=unit
21+
run: dotnet test --verbosity minimal --filter Category=unit
2322

24-
# Integration tests
2523
- name: Run integration tests
2624
if: inputs.type == 'integration-tests'
2725
shell: bash
2826
env:
2927
RELAY_ENDPOINT: ${{ inputs.relay-endpoint }}
3028
PROJECT_ID: ${{ inputs.project-id }}
31-
run: dotnet test --verbosity normal --filter Category=integration
29+
run: dotnet test --verbosity minimal --filter Category=integration

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: .NET Build & Test
2+
3+
on:
4+
push:
5+
branches: [ main, '2.0' ]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v3
17+
with:
18+
dotnet-version: |
19+
8.0.x
20+
21+
- name: Restore dependencies
22+
run: dotnet restore
23+
working-directory: ./
24+
25+
- name: Build
26+
run: dotnet build --no-restore
27+
working-directory: ./
28+
29+
- name: Upload build artifacts
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: build-artifacts
33+
path: |
34+
**/bin/**/*.dll
35+
!**/Core Modules/**/bin/**/*.dll
36+
!**/Tests/**/bin/**/*.dll
37+
38+
test:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
strategy:
42+
matrix:
43+
test-type: [unit-tests, integration-tests]
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Setup .NET
49+
uses: actions/setup-dotnet@v3
50+
with:
51+
dotnet-version: |
52+
8.0.x
53+
54+
- name: Run tests
55+
uses: ./.github/actions/ci
56+
with:
57+
type: ${{ matrix.test-type }}
58+
project-id: ${{ secrets.PROJECT_ID }}

.github/workflows/dotnet_build.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/pull_request.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 61 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,68 @@
1-
name: Release to NuGet
1+
name: Release
22

33
on:
44
release:
55
types: [published]
6-
6+
77
jobs:
8-
build:
8+
test:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 15
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v3
17+
with:
18+
dotnet-version: |
19+
8.0.x
20+
21+
- name: Run tests
22+
uses: ./.github/actions/ci
23+
with:
24+
type: 'unit-tests'
25+
project-id: ${{ secrets.PROJECT_ID }}
26+
27+
pack:
28+
needs: test
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 15
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Setup .NET
36+
uses: actions/setup-dotnet@v3
37+
with:
38+
dotnet-version: |
39+
8.0.x
40+
41+
- name: Build Release
42+
run: dotnet build -c Release
43+
44+
- name: Pack nugets
45+
run: dotnet pack -c Release --no-build --output .
46+
47+
- name: Push to NuGet
48+
run: dotnet nuget push "*.nupkg" --api-key ${{secrets.nuget_api_key}} --source https://api.nuget.org/v3/index.json
49+
50+
- name: Upload build artifacts
51+
uses: actions/upload-artifact@v3
52+
with:
53+
name: build-artifacts
54+
path: |
55+
**/bin/**/*.dll
56+
!**/Tests/**/bin/**/*.dll
57+
58+
dispatch:
59+
needs: pack
960
runs-on: ubuntu-latest
10-
timeout-minutes: 5
1161
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v2
14-
- name: Setup .NET
15-
uses: actions/setup-dotnet@v1
16-
with:
17-
dotnet-version: |
18-
3.1.x
19-
6.0.x
20-
- name: Build
21-
run: dotnet build -c Release
22-
- uses: ./.github/actions/ci
23-
with:
24-
type: 'unit-tests'
25-
project-id: ${{ secrets.PROJECT_ID }}
26-
- name: Pack nugets
27-
run: dotnet pack -c Release --no-build --output .
28-
- name: Push to NuGet
29-
run: dotnet nuget push "*.nupkg" --api-key ${{secrets.nuget_api_key}} --source https://api.nuget.org/v3/index.json
62+
- name: Trigger workflow in WalletConnectUnity
63+
uses: peter-evans/repository-dispatch@v2
64+
with:
65+
token: ${{ secrets.REPOSITORY_DISPATCH_PAT }}
66+
repository: walletconnect/walletconnectunity
67+
event-type: new-release
68+
client-payload: '{"tag_name": "${{ github.event.release.tag_name }}", "sha": "${{ github.sha }}"}'

Core Modules/WalletConnectSharp.Storage/FileSystemStorage.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class FileSystemStorage : InMemoryStorage
1616
/// </summary>
1717
public string FilePath { get; private set; }
1818

19-
private readonly SemaphoreSlim _semaphoreSlim = new(1);
19+
private SemaphoreSlim _semaphoreSlim;
2020

2121
/// <summary>
2222
/// A new FileSystemStorage module that reads/writes all storage
@@ -40,12 +40,14 @@ public FileSystemStorage(string filePath = null)
4040
/// as well as loads in the JSON file
4141
/// </summary>
4242
/// <returns></returns>
43-
public override Task Init()
43+
public override async Task Init()
4444
{
4545
if (Initialized)
46-
return Task.CompletedTask;
46+
return;
47+
48+
_semaphoreSlim = new SemaphoreSlim(1, 1);
4749

48-
return Task.WhenAll(
50+
await Task.WhenAll(
4951
Load(), base.Init()
5052
);
5153
}

Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<DefaultVersion>2.1.6</DefaultVersion>
5-
<DefaultTargetFrameworks>net6.0;netcoreapp3.1;netstandard2.1;</DefaultTargetFrameworks>
4+
<DefaultVersion>2.1.7</DefaultVersion>
5+
<DefaultTargetFrameworks>net6.0;net7.0;net8.0;netstandard2.1;</DefaultTargetFrameworks>
6+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
67
</PropertyGroup>
78
<PropertyGroup Label="C#">
89
<LangVersion>latest</LangVersion>
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
5-
<PackageVersion>2.0.0</PackageVersion>
6-
<AssemblyVersion>2.0.0</AssemblyVersion>
7-
<FileVersion>2.0.0</FileVersion>
8-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<PackageVersion>2.0.0</PackageVersion>
6+
<AssemblyVersion>2.0.0</AssemblyVersion>
7+
<FileVersion>2.0.0</FileVersion>
8+
</PropertyGroup>
99

10-
<ItemGroup>
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" />
12-
<PackageReference Include="xunit" />
13-
<PackageReference Include="xunit.runner.visualstudio">
14-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
15-
<PrivateAssets>all</PrivateAssets>
16-
</PackageReference>
17-
<PackageReference Include="coverlet.collector">
18-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19-
<PrivateAssets>all</PrivateAssets>
20-
</PackageReference>
21-
</ItemGroup>
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
12+
<PackageReference Include="xunit"/>
13+
<PackageReference Include="xunit.runner.visualstudio">
14+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
15+
<PrivateAssets>all</PrivateAssets>
16+
</PackageReference>
17+
<PackageReference Include="coverlet.collector">
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
<PrivateAssets>all</PrivateAssets>
20+
</PackageReference>
21+
</ItemGroup>
2222

23-
<ItemGroup>
24-
<ProjectReference Include="..\..\WalletConnectSharp.Auth\WalletConnectSharp.Auth.csproj" />
25-
<ProjectReference Include="..\WalletConnectSharp.Tests.Common\WalletConnectSharp.Tests.Common.csproj" />
26-
</ItemGroup>
23+
<ItemGroup>
24+
<ProjectReference Include="..\..\WalletConnectSharp.Auth\WalletConnectSharp.Auth.csproj"/>
25+
<ProjectReference Include="..\WalletConnectSharp.Tests.Common\WalletConnectSharp.Tests.Common.csproj"/>
26+
</ItemGroup>
2727

2828
</Project>
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
5-
<PackageVersion>2.0.0</PackageVersion>
6-
<AssemblyVersion>2.0.0</AssemblyVersion>
7-
<FileVersion>2.0.0</FileVersion>
8-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<PackageVersion>2.0.0</PackageVersion>
6+
<AssemblyVersion>2.0.0</AssemblyVersion>
7+
<FileVersion>2.0.0</FileVersion>
8+
</PropertyGroup>
99

10-
<ItemGroup>
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" />
12-
<PackageReference Include="xunit" />
13-
<PackageReference Include="xunit.runner.visualstudio">
14-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
15-
<PrivateAssets>all</PrivateAssets>
16-
</PackageReference>
17-
<PackageReference Include="coverlet.collector">
18-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19-
<PrivateAssets>all</PrivateAssets>
20-
</PackageReference>
21-
</ItemGroup>
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
12+
<PackageReference Include="xunit"/>
13+
<PackageReference Include="xunit.runner.visualstudio">
14+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
15+
<PrivateAssets>all</PrivateAssets>
16+
</PackageReference>
17+
<PackageReference Include="coverlet.collector">
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
<PrivateAssets>all</PrivateAssets>
20+
</PackageReference>
21+
</ItemGroup>
2222

23-
<ItemGroup>
24-
<ProjectReference Include="..\..\Core Modules\WalletConnectSharp.Crypto\WalletConnectSharp.Crypto.csproj" />
25-
<ProjectReference Include="..\..\Core Modules\WalletConnectSharp.Network\WalletConnectSharp.Network.csproj" />
26-
</ItemGroup>
23+
<ItemGroup>
24+
<ProjectReference Include="..\..\Core Modules\WalletConnectSharp.Crypto\WalletConnectSharp.Crypto.csproj"/>
25+
<ProjectReference Include="..\..\Core Modules\WalletConnectSharp.Network\WalletConnectSharp.Network.csproj"/>
26+
</ItemGroup>
2727

2828
</Project>

0 commit comments

Comments
 (0)