Skip to content
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
74 changes: 74 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build

on:
push:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

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

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.10
with:
versionSpec: "5.7.0"

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.10
with:
useConfigFile: true
configFilePath: "GitVersion.yml"

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

# Cache packages for faster subsequent runs
- uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Restore
working-directory: ./src
run: >-
dotnet nuget add source --username USERNAME --password ${{ secrets.GH_PACKAGES_TOKEN }} --store-password-in-clear-text --name github https://nuget.pkg.github.com/CenterEdge/index.json
&& dotnet restore ./CenterEdge.Async.sln

- name: Build
working-directory: ./src
run: dotnet build --no-restore -c Release /p:Version=${{ steps.gitversion.outputs.semVer }} ./CenterEdge.Async.sln

- name: Test
working-directory: ./src
run: dotnet test --no-build -c Release -f net5.0 -l 'trx;LogFileName=${{ runner.temp }}/results.trx' ./CenterEdge.Async.sln

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Unit Tests
path: ${{ runner.temp }}/results.trx
reporter: dotnet-trx

- name: Pack
working-directory: ./src
run: dotnet pack --no-build -c Release /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }} ./CenterEdge.Async.sln

- name: Push
working-directory: ./src
# Publish CI packages from PRs and tagged releases
if: ${{ startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/pull/') }}
run: dotnet nuget push **/*.${{ steps.gitversion.outputs.nuGetVersionV2 }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s github
10 changes: 10 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
mode: ContinuousDelivery
branches:
pull-request:
mode: ContinuousDeployment
tag: ci-pr-
track-merge-target: true
ignore:
sha: []
merge-message-formats: {}
tag-prefix: ""
76 changes: 0 additions & 76 deletions Jenkinsfile

This file was deleted.

6 changes: 6 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<!-- Since GitHub Packages doesn't support snupkg, include the PDB in the main nupkg file -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
</Project>