Skip to content

Commit

Permalink
Initial CI package build (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusturewicz committed Aug 28, 2021
1 parent dfa4f63 commit c17e631
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 9 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
name: CI/CD

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches: [main]
push:
branches: [main]
tags: [v*]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
source-url: https://nuget.pkg.github.com/marcusturewicz/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
run: dotnet build --no-restore -c Release
- name: Test
run: dotnet test --no-build --verbosity normal
run: dotnet test --no-build --verbosity normal -c Release
- name: Pack
run: dotnet pack src/Standards.AspNetCore -c Release --no-build
- name: Push to GitHub Package Registry
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')
run: dotnet nuget push src/Standards.AspNetCore/bin/Release/*.nupkg
- name: Push to nuget.org
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags')
run: dotnet nuget push src/Standards.AspNetCore/bin/Release/*.nupkg -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json
25 changes: 23 additions & 2 deletions src/Standards.AspNetCore/Standards.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,31 @@

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<PackageId>Standards.AspNetCore</PackageId>
<Authors>Marcus Turewicz</Authors>
<Description>Library of standards implemented to use in ASP.NET Core</Description>
<Copyright>Copyright (c) Marcus Turewicz 2021</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>standards iso dates api</PackageTags>
<!-- <PackageIcon>logo.png</PackageIcon> -->

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.231" PrivateAssets="All" />
</ItemGroup>

<!-- <ItemGroup>
<None Include="..\..\logo.png" Pack="true" PackagePath=""/>
</ItemGroup> -->

</Project>
11 changes: 11 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0.0-alpha.1",
"gitCommitIdShortAutoMinimum": 7,
"nugetPackageVersion": {
"semVer": 2
},
"publicReleaseRefSpec": [
"^refs/tags/v\\d+\\.\\d+"
]
}

0 comments on commit c17e631

Please sign in to comment.