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

Create GH actions release pipeline #75

Merged
merged 1 commit into from
Nov 21, 2022
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
91 changes: 91 additions & 0 deletions .github/workflows/buildAndDeploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Build and Test

on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
env:
solutionName: UriTemplates.sln
outputFolder: ./buildArtifacts

steps:
- name: Checkout repository
uses: actions/[email protected]
with:
submodules: true

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore ${{ env.solutionName }}

- name: Build
run: dotnet build ${{ env.solutionName }} --no-restore -c Release

- name: Test
run: dotnet test ${{ env.solutionName }} --no-build --verbosity normal -c Release /p:CollectCoverage=true /p:CoverletOutput=./TestResults/ /p:CoverletOutputFormat=opencover

- name: Pack
run: dotnet pack ${{ env.solutionName }} /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg --no-build --output ${{ env.outputFolder }} -c Release

- name: Upload Nuget Package and Symbols
uses: actions/upload-artifact@v2
with:
name: drop
path: |
${{ env.outputFolder }}/*.nupkg
${{ env.outputFolder }}/*.snupkg

analyze:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
submodules: true

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.x

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: csharp

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

deploy:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
environment:
name: production
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.x

- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: drop

- name: Nuget push
run: dotnet nuget push "*.nupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k ${{ secrets.PUBLISH_GH_TOKEN }}

7 changes: 5 additions & 2 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Uri Templates #

##2.0.0
- [Breaking] Updated Target Framework Moniker to `netstandard2.0` and drops `net35`, `net40`, `net45` and `netstandard1.0`.

##1.1.2
- Added Type converter support

##1.1.1
- Fixed bug parsing query paranmeter with comma delimited values
- Fixed bug parsing query parameter with comma delimited values


##1.1.0
Expand All @@ -30,7 +33,7 @@

##0.6.3

- Added ToString() overload to allow retreiving unresolved template
- Added ToString() overload to allow retrieving unresolved template

##0.6.2

Expand Down
Binary file added UriTemplateKey.snk
Binary file not shown.
4 changes: 2 additions & 2 deletions src/UriTemplateTests/UriTemplateTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
15 changes: 13 additions & 2 deletions src/UriTemplates/UriTemplates.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net35;net40;net45;netstandard1.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<RootNamespace>Tavis</RootNamespace>
<AssemblyName>Tavis.UriTemplates</AssemblyName>
Expand All @@ -14,10 +13,22 @@
<PackageProjectUrl>https://github.com/tavis-software/Tavis.UriTemplates</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<SignAssembly>true</SignAssembly>
<RepositoryUrl>https://github.com/tavis-software/Tavis.UriTemplates</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AssemblyOriginatorKeyFile>../../UriTemplateKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

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

<PropertyGroup Condition="'$(TargetFramework)'!='netstandard1.0'">
<DefineConstants>DEBUG;TRACE;TYPE_CONVERTER</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
</Project>