~ruther/NosSmooth.Comms

6200e9cc894ce951c55245d69b86fa942111341f — Rutherther 2 years ago 3b9b88c
ci: add build and nuget push ci
A .github/workflows/build-test.yml => .github/workflows/build-test.yml +41 -0
@@ 0,0 1,41 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Setup .NET
      uses: actions/setup-dotnet@v3
      with:
        dotnet-version: | 
          6.0.x
          7.0.x
    - name: Restore dependencies
      run: dotnet restore NosSmooth.Comms.sln
    - name: Build
      run: dotnet build NosSmooth.Comms.sln --no-restore --version-suffix "main$GITHUB_RUN_ID"
    - name: Test
      run: dotnet test NosSmooth.Comms.sln --no-build --verbosity normal

    - name: Pack app
      if: github.ref == 'refs/heads/main' && github.event_name == 'push'
      run: dotnet pack NosSmooth.Comms.sln -c Release --no-restore --version-suffix "main$GITHUB_RUN_ID" -o nuget

    - name: Publish NuGet on MyGet
      working-directory: nuget
      if: github.ref == 'refs/heads/main' && github.event_name == 'push'
      run: dotnet nuget push *.nupkg --skip-duplicate -k $MYGET_AUTH_TOKEN -s https://www.myget.org/F/nossmooth/api/v3/index.json
      env:
        MYGET_AUTH_TOKEN: ${{secrets.MYGET_KEY}}
\ No newline at end of file

A .github/workflows/nuget-push.yml => .github/workflows/nuget-push.yml +31 -0
@@ 0,0 1,31 @@
# This workflow pushes builds to the private github nuget repo on a push or merge.

name: NuGet Update

on:
  release:
    types: [published]
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    name: Update NuGet Package
    steps:
    
    - name: Checkout Repository
      uses: actions/checkout@v2
      
    - name: Setup .NET Core SDK
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '7.0.x'
        
    - name: Pack app
      run: dotnet pack NosSmooth.Comms.sln --configuration Release -o nuget
      
    - name: Publish NuGet
      working-directory: nuget
      run: dotnet nuget push *.nupkg --skip-duplicate -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
      env:
        NUGET_AUTH_TOKEN: ${{secrets.NUGET_KEY}}

M Directory.Build.props => Directory.Build.props +6 -0
@@ 10,6 10,12 @@

        <CodeAnalysisRuleSet>$(StyleCopRuleset)</CodeAnalysisRuleSet>
    </PropertyGroup>
    
    <PropertyGroup>
        <RepositoryUrl>https://github.com/Rutherther/NosSmooth.Comms</RepositoryUrl>
        <RepositoryBranch>main</RepositoryBranch>
        <PackageProjectUrl>https://github.com/Rutherther/NosSmooth.Comms</PackageProjectUrl>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.261">

M NosSmooth.Comms.sln => NosSmooth.Comms.sln +5 -0
@@ 16,6 16,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsolePacketLogger", "src\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NosSmooth.Comms.Core", "src\Core\NosSmooth.Comms.Core\NosSmooth.Comms.Core.csproj", "{70275C91-1114-4673-8F9B-B0C311BFE337}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".metadata", ".metadata", "{EB208A2A-0F43-4573-8DE7-2F413DE4E5D9}"
	ProjectSection(SolutionItems) = preProject
		Directory.Build.props = Directory.Build.props
	EndProjectSection
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU

M src/Core/NosSmooth.Comms.Abstractions/NosSmooth.Comms.Abstractions.csproj => src/Core/NosSmooth.Comms.Abstractions/NosSmooth.Comms.Abstractions.csproj +0 -2
@@ 5,8 5,6 @@
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
        <RootNamespace>NosSmooth.Comms.Data</RootNamespace>
        <RepositoryUrl>https://github.com/Rutherther/NosSmooth.Comms/</RepositoryUrl>
        <PackageLicenseUrl>MIT</PackageLicenseUrl>
        <VersionPrefix>1.0.0</VersionPrefix>
    </PropertyGroup>


M src/Core/NosSmooth.Comms.Core/NosSmooth.Comms.Core.csproj => src/Core/NosSmooth.Comms.Core/NosSmooth.Comms.Core.csproj +0 -2
@@ 4,8 4,6 @@
        <TargetFramework>net7.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
        <RepositoryUrl>https://github.com/Rutherther/NosSmooth.Comms/</RepositoryUrl>
        <PackageLicenseUrl>MIT</PackageLicenseUrl>
        <VersionPrefix>1.0.0</VersionPrefix>
    </PropertyGroup>


M src/Local/NosSmooth.Comms.Inject/NosSmooth.Comms.Inject.csproj => src/Local/NosSmooth.Comms.Inject/NosSmooth.Comms.Inject.csproj +0 -2
@@ 6,8 6,6 @@
        <Nullable>enable</Nullable>
        <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
        <EnableDynamicLoading>true</EnableDynamicLoading>
        <RepositoryUrl>https://github.com/Rutherther/NosSmooth.Comms/</RepositoryUrl>
        <PackageLicenseUrl>MIT</PackageLicenseUrl>
        <VersionPrefix>1.0.0</VersionPrefix>
    </PropertyGroup>


M src/Local/NosSmooth.Comms.Local/NosSmooth.Comms.Local.csproj => src/Local/NosSmooth.Comms.Local/NosSmooth.Comms.Local.csproj +0 -2
@@ 4,8 4,6 @@
        <TargetFramework>net7.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
        <RepositoryUrl>https://github.com/Rutherther/NosSmooth.Comms/</RepositoryUrl>
        <PackageLicenseUrl>MIT</PackageLicenseUrl>
        <VersionPrefix>1.0.0</VersionPrefix>
    </PropertyGroup>


Do not follow this link