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

Updated Packages and Build #1

Merged
merged 1 commit into from
Jan 22, 2025
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
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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: Build

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

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
32 changes: 32 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish

on:
release:
types: [published]

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Pack
run: dotnet pack --configuration Release --no-restore
- name: Publish
uses: softprops/action-gh-release@v2.0.8
with:
files: |
/home/runner/work/Cosmos.Threading/Cosmos.Threading/bin/Debug/Cosmos.Threading*.nupkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 4 additions & 3 deletions Cosmos.Threading/Cosmos.Threading.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.41.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.46.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Cosmos.Threading

[![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)
![GitHub Actions](https://github.com/DerekGn/Cosmos.Threading/actions/workflows/build.yml/badge.svg)

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

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

Expand Down
4 changes: 2 additions & 2 deletions TestConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace TestConsole
{
internal class Program
internal static class Program
{
private static CosmosClient CreateCosmosClient(string connectionString)
{
Expand Down Expand Up @@ -65,7 +65,7 @@ private static async Task Main(string[] args)
services
.AddLogging(builder => builder.AddSerilog())
.AddLogging()
.AddSingleton(CreateCosmosClient(configuration["Cosmos:ConnectionString"]))
.AddSingleton(CreateCosmosClient(configuration["Cosmos:ConnectionString"]!))
.AddSingleton<MutexInitialization>()
.AddSingleton<Mutex>()
.AddSingleton<Executor>();
Expand Down
25 changes: 13 additions & 12 deletions TestConsole/TestConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
<PackageReference Include="Serilog" Version="4.0.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
</ItemGroup>

Expand Down
45 changes: 0 additions & 45 deletions azure-pipelines.yml

This file was deleted.

Loading