Skip to content

Commit

Permalink
move build to github
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Jul 29, 2023
1 parent 7168612 commit e2d6d6c
Show file tree
Hide file tree
Showing 11 changed files with 242 additions and 90 deletions.
52 changes: 52 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# EditorConfig: https://EditorConfig.org

root = true

# All Files
[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

# XML Configuration Files
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct,refactorlog,runsettings}]
indent_size = 2

# JSON Files
[*.{json,json5,webmanifest}]
indent_size = 2

# Project Files
[*.{csproj,sqlproj}]
indent_size = 2

# YAML Files
[*.{yml,yaml}]
indent_size = 2

# Markdown Files
[*.md]
trim_trailing_whitespace = false

# Web Files
[*.{htm,html,js,jsm,ts,tsx,css,sass,scss,less,pcss,svg,vue}]
indent_size = 2

# Batch Files
[*.{cmd,bat}]
end_of_line = crlf

# Bash Files
[*.sh]
end_of_line = lf

[*.{cs,vb}]
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = true
dotnet_style_namespace_match_folder = true

[*.cs]
csharp_using_directive_placement = outside_namespace
csharp_style_namespace_declarations = file_scoped:warning
109 changes: 109 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Build

env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BUILD_PATH: '${{github.workspace}}/artifacts'
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

on:
push:
branches:
- main
- develop
tags:
- 'v*'
pull_request:
branches:
- main
- develop

jobs:

build:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Restore Dependencies
run: dotnet restore

- name: Build Solution
run: dotnet build --no-restore --configuration Release

- name: Start Cosmos DB
shell: pwsh
run: |
Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator"
Start-CosmosDbEmulator
- name: Run Test
run: dotnet test --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings

- name: Generate Coverage
uses: danielpalme/[email protected]
with:
reports: '${{github.workspace}}/test/*/TestResults/*/coverage.info'
targetdir: ${{env.BUILD_PATH}}
reporttypes: lcov

- name: Report Coverage
if: success()
uses: coverallsapp/github-action@v2
with:
file: artifacts/lcov.info
format: lcov

- name: Create Packages
if: success() && github.event_name != 'pull_request'
run: dotnet pack --configuration Release --include-symbols --include-source --no-build --no-restore --output "${{env.BUILD_PATH}}"

- name: Upload Packages
if: success() && github.event_name != 'pull_request'
uses: actions/upload-artifact@v3
with:
name: packages
path: '${{env.BUILD_PATH}}'

deploy:
runs-on: ubuntu-latest
needs: build
if: success() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))

steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: packages

- name: Publish Packages GitHub
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://nuget.pkg.github.com/loresoft/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
done
- name: Publish Packages feedz
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://f.feedz.io/loresoft/open/nuget/index.json --api-key ${{ secrets.FEEDDZ_KEY }} --skip-duplicate
done
- name: Publish Packages Nuget
if: startsWith(github.ref, 'refs/tags/v')
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate
done
13 changes: 5 additions & 8 deletions Cosmos.Identity.sln
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
# Visual Studio Version 17
VisualStudioVersion = 17.6.33829.357
MinimumVisualStudioVersion = 15.0.26124.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Identity", "src\Cosmos.Identity\Cosmos.Identity.csproj", "{280BCC06-DC66-48F4-89A5-BC7E15E6BD2C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Identity.Tests", "test\Cosmos.Identity.Tests\Cosmos.Identity.Tests.csproj", "{F1F6A235-EDFB-48BB-97C8-098FA5F656A5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2DBB4192-B9EF-43A0-A409-0EA1B63AA4D0}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
build\common.props = build\common.props
coveralls.ps1 = coveralls.ps1
coverlet.runsettings = coverlet.runsettings
src\Directory.Build.props = src\Directory.Build.props
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
README.md = README.md
build\sourcelink.props = build\sourcelink.props
build\version.props = build\version.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{D4FCB89C-143F-4526-ACF3-4EF8BD035C01}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.Website", "samples\Sample.Website\Sample.Website.csproj", "{0841A17B-ED44-436C-8BEE-E156E6A3B8ED}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Website", "samples\Sample.Website\Sample.Website.csproj", "{0841A17B-ED44-436C-8BEE-E156E6A3B8ED}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Cosmos.Identity
Cosmos DB provider for ASP.NET Core Identity framework

[![Build status](https://ci.appveyor.com/api/projects/status/aj2b6swwjdl0v8wr?svg=true)](https://ci.appveyor.com/project/LoreSoft/cosmos-identity)
[![Build Project](https://github.com/loresoft/Cosmos.Identity/actions/workflows/dotnet.yml/badge.svg)](https://github.com/loresoft/Cosmos.Identity/actions/workflows/dotnet.yml)

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

Expand All @@ -18,13 +18,6 @@ To install Cosmos.Identity, run the following command in the Package Manager Con
More information about NuGet package available at
<https://nuget.org/packages/Cosmos.Identity>

## Development Builds

Development builds are available on the myget.org feed. A development build is promoted to the main NuGet feed when it's determined to be stable.

In your Package Manager settings add the following package source for development builds:
<http://www.myget.org/F/loresoft/>

## Usage

appsettings.json configuration
Expand Down
42 changes: 0 additions & 42 deletions appveyor.yml

This file was deleted.

12 changes: 0 additions & 12 deletions coveralls.ps1

This file was deleted.

6 changes: 4 additions & 2 deletions coverlet.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Format>opencover</Format>
<Format>lcov</Format>
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute,TestSDKAutoGeneratedCode</ExcludeByAttribute>
<SkipAutoProps>true</SkipAutoProps>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
</RunSettings>
4 changes: 2 additions & 2 deletions samples/Sample.Website/Sample.Website.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<UserSecretsId>aspnet-Sample.Website-0939FBC5-AC52-4275-AE28-0EA2CCD1FE8A</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="7.0.9" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 4 additions & 5 deletions src/Cosmos.Identity/Cosmos.Identity.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<NoWarn>1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cosmos.Abstracts" Version="4.0.66" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="6.0.1" />
<PackageReference Include="Cosmos.Abstracts" Version="5.1.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.9" />
</ItemGroup>

<ItemGroup>
Expand Down
55 changes: 55 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup Label="Package">
<Description>Cosmos DB provider for ASP.NET Core Identity framework.</Description>
<Copyright>Copyright © $([System.DateTime]::Now.ToString(yyyy)) LoreSoft</Copyright>
<Authors>LoreSoft</Authors>
<NeutralLanguage>en-US</NeutralLanguage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Cosmos;CosmosDB;Identity;Membership</PackageTags>
<PackageProjectUrl>https://github.com/loresoft/Cosmos.Identity</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>logo.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/loresoft/Cosmos.Identity</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<PropertyGroup>
<DebugType>portable</DebugType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>1591</NoWarn>
</PropertyGroup>

<PropertyGroup>
<MinVerTagPrefix>v</MinVerTagPrefix>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<None Include=".\..\..\logo.png">
<Pack>true</Pack>
<PackagePath>\</PackagePath>
<Visible>false</Visible>
</None>
<None Include=".\..\..\README.md">
<Pack>true</Pack>
<PackagePath>\</PackagePath>
<Visible>false</Visible>
</None>
</ItemGroup>

</Project>
Loading

0 comments on commit e2d6d6c

Please sign in to comment.