Skip to content

Commit

Permalink
Add workflow actions
Browse files Browse the repository at this point in the history
  • Loading branch information
RobThree committed Mar 7, 2024
1 parent ce5e341 commit 90612aa
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 21 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publishnuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Nuget Package

on:
release:
types:
- created

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '8.0.x' ]

steps:
- uses: actions/checkout@v4

- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Setup NuGet
uses: NuGet/setup-nuget@v2

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build -c Release --no-restore /p:Version="${{ github.event.release.tag_name }}"

- name: Run tests
run: dotnet test -c Release --no-restore --no-build

- name: Create packages
run:
dotnet pack ${{ github.event.repository.name }} -c Release --no-restore --no-build -p:Version="${{ github.event.release.tag_name }}"
dotnet pack ${{ github.event.repository.name }}.Configuration -c Release --no-restore --no-build -p:Version="${{ github.event.release.tag_name }}"
dotnet pack ${{ github.event.repository.name }}.DependencyInjection -c Release --no-restore --no-build -p:Version="${{ github.event.release.tag_name }}"

- name: Publish
run: dotnet nuget push **\*.nupkg -s 'https://api.nuget.org/v3/index.json' -k ${{secrets.NUGET_API_KEY}}
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
push

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '8.0.x' ]

steps:
- uses: actions/checkout@v4

- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Setup NuGet
uses: NuGet/setup-nuget@v2

- name: Restore dependencies
run: dotnet restore

- name: Run tests
run: dotnet test --no-restore
5 changes: 2 additions & 3 deletions IdGen.Configuration/IdGen.Configuration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
<Authors>RobIII</Authors>
<Company>Devcorner.nl</Company>
<PackageId>IdGen.Configuration</PackageId>
<NoPackageAnalysis>true</NoPackageAnalysis>
<Product>IdGen.Configuration</Product>
<Copyright>Copyright © 2015 - 2023 Devcorner.nl</Copyright>
<Copyright>Copyright © 2015 - 2024 Devcorner.nl</Copyright>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/RobThree/IdGen</PackageProjectUrl>
Expand Down Expand Up @@ -35,7 +34,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 3 additions & 5 deletions IdGen.DependencyInjection/IdGen.DependencyInjection.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
<Company>Devcorner.nl</Company>
<PackageId>IdGen.DependencyInjection</PackageId>
<Product>IdGen.DependencyInjection</Product>
<Copyright>Copyright © 2022 - 2023 Devcorner.nl</Copyright>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Copyright>Copyright © 2022 - 2024 Devcorner.nl</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/RobThree/IdGen</PackageProjectUrl>
<PackageTags>idgen di dependency-injection</PackageTags>
<PackageReleaseNotes>Initial release</PackageReleaseNotes>
<Description>Dependency injection support for IdGen</Description>
<Version>3.0</Version>
<RootNamespace>IdGen.DependencyInjection</RootNamespace>
<PackageIcon>logo.png</PackageIcon>
<PackageIconUrl />
Expand All @@ -39,8 +37,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 5 additions & 6 deletions IdGen/IdGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
<Company>Devcorner.nl</Company>
<PackageId>IdGen</PackageId>
<Product>IdGen</Product>
<Copyright>Copyright © 2015 - 2023 Devcorner.nl</Copyright>
<Copyright>Copyright © 2015 - 2024 Devcorner.nl</Copyright>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/RobThree/IdGen</PackageProjectUrl>
<PackageTags>scalable unique id generator distributed</PackageTags>
<PackageReleaseNotes>Added NetStandard 2.0</PackageReleaseNotes>
<Description>Twitter Snowflake-alike ID generator for .Net</Description>
<Version>3.0.3</Version>
<RootNamespace>IdGen</RootNamespace>
<PackageIcon>logo.png</PackageIcon>
<PackageIconUrl />
Expand Down Expand Up @@ -42,9 +41,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="IsExternalInit" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PolySharp" Version="1.14.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
12 changes: 6 additions & 6 deletions IdGenTests/IdGenTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
<PackageReference Include="coverlet.collector" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ![Logo](https://raw.githubusercontent.com/RobThree/IdGen/master/IdGenDocumentation/icons/Help.png) IdGen

[![Build status](https://ci.appveyor.com/api/projects/status/24wqqq91u0arkf5t)](https://ci.appveyor.com/project/RobIII/idgen) <a href="https://www.nuget.org/packages/IdGen/"><img src="http://img.shields.io/nuget/v/IdGen.svg?style=flat-square" alt="NuGet version" height="18"></a>
![Build Status](https://img.shields.io/github/actions/workflow/status/RobThree/IdGen/test.yml?branch=master&style=flat-square) [![Nuget version](https://img.shields.io/nuget/v/IdGen.svg?style=flat-square)](https://www.nuget.org/packages/IdGen/)

Twitter Snowflake-alike ID generator for .Net. Available as [Nuget package](https://www.nuget.org/packages/IdGen)

Expand Down

0 comments on commit 90612aa

Please sign in to comment.