-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from andrueastman/UpdateCi
Create GH actions release pipeline
- Loading branch information
Showing
5 changed files
with
111 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/checkout@v3.0.2 | ||
with: | ||
submodules: true | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v2.1.0 | ||
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/checkout@v3.0.2 | ||
with: | ||
submodules: true | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v2.1.0 | ||
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/setup-dotnet@v2.1.0 | ||
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 }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters