Skip to content

Commit 3d8011d

Browse files
authored
Updated Packages and Build
Updated packages Migrated build to github actions Updated readme
2 parents 68254eb + c6ea3b0 commit 3d8011d

7 files changed

Lines changed: 81 additions & 64 deletions

File tree

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: Build
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: 8.0.x
23+
- name: Restore dependencies
24+
run: dotnet restore
25+
- name: Build
26+
run: dotnet build --no-restore
27+
- name: Test
28+
run: dotnet test --no-build --verbosity normal

.github/workflows/cd.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup dotnet
16+
uses: actions/setup-dotnet@v4
17+
with:
18+
dotnet-version: 8.0.x
19+
20+
- name: Install dependencies
21+
run: dotnet restore
22+
- name: Build
23+
run: dotnet build --configuration Release --no-restore
24+
- name: Pack
25+
run: dotnet pack --configuration Release --no-restore
26+
- name: Publish
27+
uses: softprops/action-gh-release@v2.0.8
28+
with:
29+
files: |
30+
/home/runner/work/Cosmos.Threading/Cosmos.Threading/bin/Debug/Cosmos.Threading*.nupkg
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cosmos.Threading/Cosmos.Threading.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
</PropertyGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.41.0" />
26-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
27-
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
25+
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.46.1" />
26+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.1" />
27+
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.1" />
28+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2829
</ItemGroup>
2930

3031
<PropertyGroup Condition="'$(Configuration)'=='Release'">

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Cosmos.Threading
22

3-
[![Build Status](https://derekgn.visualstudio.com/GitHub/_apis/build/status%2FDerekGn.Cosmos.Threading?branchName=main)](https://derekgn.visualstudio.com/GitHub/_build/latest?definitionId=14&branchName=main)
3+
![GitHub Actions](https://github.com/DerekGn/Cosmos.Threading/actions/workflows/build.yml/badge.svg)
44

5-
[![NuGet Badge](https://buildstats.info/nuget/Cosmos.Threading)](https://www.nuget.org/packages/Cosmos.Threading/)
5+
[![NuGet](https://img.shields.io/nuget/v/Cosmos.Threading.svg?style=flat-square)](https://www.nuget.org/packages/Cosmos.Threading/)
66

77
A library that contains a simple cosmos based distributed mutex. The mutex allows processes to coordinate access to a shared set of resources.
88

TestConsole/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
namespace TestConsole
3333
{
34-
internal class Program
34+
internal static class Program
3535
{
3636
private static CosmosClient CreateCosmosClient(string connectionString)
3737
{
@@ -65,7 +65,7 @@ private static async Task Main(string[] args)
6565
services
6666
.AddLogging(builder => builder.AddSerilog())
6767
.AddLogging()
68-
.AddSingleton(CreateCosmosClient(configuration["Cosmos:ConnectionString"]))
68+
.AddSingleton(CreateCosmosClient(configuration["Cosmos:ConnectionString"]!))
6969
.AddSingleton<MutexInitialization>()
7070
.AddSingleton<Mutex>()
7171
.AddSingleton<Executor>();

TestConsole/TestConsole.csproj

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
12-
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0" />
13-
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
14-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
15-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
16-
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
17-
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
18-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
19-
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
20-
<PackageReference Include="Serilog" Version="4.0.0" />
21-
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
22-
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.1" />
11+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.1" />
12+
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="9.0.1" />
13+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.1" />
14+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.1" />
15+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.1" />
16+
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.1" />
17+
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.1" />
18+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.1" />
19+
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="9.0.1" />
20+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
21+
<PackageReference Include="Serilog" Version="4.2.0" />
22+
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.0" />
23+
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
2324
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
2425
</ItemGroup>
2526

azure-pipelines.yml

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

0 commit comments

Comments
 (0)