Skip to content
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

chore: ci updates #167

Merged
merged 5 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ inputs:
runs:
using: "composite"
steps:
# Package buildss
- name: Run tests
if: inputs.type == 'unit-tests'
shell: bash
run: dotnet test --verbosity normal --filter Category=unit
run: dotnet test --verbosity minimal --filter Category=unit

# Integration tests
- name: Run integration tests
if: inputs.type == 'integration-tests'
shell: bash
env:
RELAY_ENDPOINT: ${{ inputs.relay-endpoint }}
PROJECT_ID: ${{ inputs.project-id }}
run: dotnet test --verbosity normal --filter Category=integration
run: dotnet test --verbosity minimal --filter Category=integration
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: .NET Build & Test

on:
push:
branches: [ main, '2.0' ]
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x

- name: Restore dependencies
run: dotnet restore
working-directory: ./

- name: Build
run: dotnet build --no-restore
working-directory: ./

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
**/bin/**/*.dll
!**/Core Modules/**/bin/**/*.dll
!**/Tests/**/bin/**/*.dll

test:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
test-type: [unit-tests, integration-tests]

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x

- name: Run tests
uses: ./.github/actions/ci
with:
type: ${{ matrix.test-type }}
project-id: ${{ secrets.PROJECT_ID }}
31 changes: 0 additions & 31 deletions .github/workflows/dotnet_build.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/pull_request.yml

This file was deleted.

79 changes: 59 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,68 @@
name: Release to NuGet
name: Release

on:
workflow_dispatch:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
6.0.x
- name: Build
run: dotnet build -c Release
- uses: ./.github/actions/ci
with:
type: 'unit-tests'
project-id: ${{ secrets.PROJECT_ID }}
- name: Pack nugets
run: dotnet pack -c Release --no-build --output .
- name: Push to NuGet
run: dotnet nuget push "*.nupkg" --api-key ${{secrets.nuget_api_key}} --source https://api.nuget.org/v3/index.json
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x

- name: Run tests
uses: ./.github/actions/ci
with:
type: 'unit-tests'
project-id: ${{ secrets.PROJECT_ID }}

- name: Build Release
run: dotnet build -c Release

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
**/bin/**/*.dll
!**/Tests/**/bin/**/*.dll

pack:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4

# - name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: |
# 8.0.x
#
# - name: Pack nugets
# run: dotnet pack -c Release --no-build --output .
#
# - name: Push to NuGet
# run: dotnet nuget push "*.nupkg" --api-key ${{secrets.nuget_api_key}} --source https://api.nuget.org/v3/index.json

dispatch:
needs: pack
runs-on: ubuntu-latest
steps:
- name: Trigger workflow in WalletConnectUnity
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.REPOSITORY_DISPATCH_PAT }}
repository: walletconnect/walletconnectunity
event-type: new-release
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DefaultVersion>2.1.6</DefaultVersion>
<DefaultTargetFrameworks>net6.0;netcoreapp3.1;netstandard2.1;</DefaultTargetFrameworks>
<DefaultTargetFrameworks>net6.0;net7.0;net8.0;netstandard2.1;</DefaultTargetFrameworks>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<PropertyGroup Label="C#">
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
<PackageVersion>2.0.0</PackageVersion>
<AssemblyVersion>2.0.0</AssemblyVersion>
<FileVersion>2.0.0</FileVersion>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageVersion>2.0.0</PackageVersion>
<AssemblyVersion>2.0.0</AssemblyVersion>
<FileVersion>2.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
<PackageReference Include="xunit"/>
<PackageReference Include="xunit.runner.visualstudio">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\WalletConnectSharp.Auth\WalletConnectSharp.Auth.csproj" />
<ProjectReference Include="..\WalletConnectSharp.Tests.Common\WalletConnectSharp.Tests.Common.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\WalletConnectSharp.Auth\WalletConnectSharp.Auth.csproj"/>
<ProjectReference Include="..\WalletConnectSharp.Tests.Common\WalletConnectSharp.Tests.Common.csproj"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
<PackageVersion>2.0.0</PackageVersion>
<AssemblyVersion>2.0.0</AssemblyVersion>
<FileVersion>2.0.0</FileVersion>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageVersion>2.0.0</PackageVersion>
<AssemblyVersion>2.0.0</AssemblyVersion>
<FileVersion>2.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
<PackageReference Include="xunit"/>
<PackageReference Include="xunit.runner.visualstudio">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Core Modules\WalletConnectSharp.Crypto\WalletConnectSharp.Crypto.csproj" />
<ProjectReference Include="..\..\Core Modules\WalletConnectSharp.Network\WalletConnectSharp.Network.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core Modules\WalletConnectSharp.Crypto\WalletConnectSharp.Crypto.csproj"/>
<ProjectReference Include="..\..\Core Modules\WalletConnectSharp.Network\WalletConnectSharp.Network.csproj"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.1;netcoreapp3.1</TargetFrameworks>
<PackageVersion>2.0.0</PackageVersion>
<AssemblyVersion>2.0.0</AssemblyVersion>
<FileVersion>2.0.0</FileVersion>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<PackageId>WalletConnect.Examples</PackageId>
<Title>WalletConnectSharp.Examples</Title>
<Authors>pedrouid, gigajuwels, edkek</Authors>
<Description>A port of the TypeScript SDK to C#. A complete implementation of the WalletConnect v2 protocol that can be used to connect to external wallets or connect a wallet to an external Dapp</Description>
<Copyright>Copyright (c) WalletConnect 2023</Copyright>
<PackageProjectUrl>https://walletconnect.org/</PackageProjectUrl>
<RepositoryUrl>https://github.com/WalletConnect/WalletConnectSharp</RepositoryUrl>
<RepositoryType>git </RepositoryType>
<PackageTags>walletconnect wallet web3 ether ethereum blockchain evm</PackageTags>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageVersion>2.0.0</PackageVersion>
<AssemblyVersion>2.0.0</AssemblyVersion>
<FileVersion>2.0.0</FileVersion>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<PackageId>WalletConnect.Examples</PackageId>
<Title>WalletConnectSharp.Examples</Title>
<Authors>pedrouid, gigajuwels, edkek</Authors>
<Description>A port of the TypeScript SDK to C#. A complete implementation of the WalletConnect v2 protocol that can be used to connect to external wallets or connect a wallet to an external Dapp</Description>
<Copyright>Copyright (c) WalletConnect 2023</Copyright>
<PackageProjectUrl>https://walletconnect.org/</PackageProjectUrl>
<RepositoryUrl>https://github.com/WalletConnect/WalletConnectSharp</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>walletconnect wallet web3 ether ethereum blockchain evm</PackageTags>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\WalletConnectSharp.Sign\WalletConnectSharp.Sign.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\WalletConnectSharp.Sign\WalletConnectSharp.Sign.csproj"/>
</ItemGroup>

</Project>
Loading
Loading