Skip to content

Commit 02bba43

Browse files
authored
Merge pull request #4 from bbtbir/feature/Workflow
added Release Workflow
2 parents af503c7 + 3281e00 commit 02bba43

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: CI
55
on:
66
push:
77
branches:
8-
- master
8+
- main
99
- develop
1010
- "feature/**"
1111
- "release/**"

.github/workflows/release.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This workflow will build a .NET project
2+
3+
name: Release
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
defaults:
10+
run:
11+
working-directory: src
12+
13+
jobs:
14+
build:
15+
env:
16+
BUILD_CONFIG: "Release"
17+
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
matrix:
21+
os: [ubuntu-latest]
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
26+
- name: Get Build Version
27+
run: |
28+
Import-Module ..\build\GetBuildVersion.psm1
29+
Write-Host $Env:GITHUB_REF
30+
$version = GetBuildVersion -VersionString $Env:GITHUB_REF
31+
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
32+
shell: pwsh
33+
34+
- name: Setup .NET
35+
uses: actions/setup-dotnet@v3
36+
with:
37+
dotnet-version: 6.0.x
38+
39+
- name: Restore dependencies
40+
run: dotnet restore
41+
42+
- name: Build
43+
run: dotnet build --configuration $BUILD_CONFIG -p:Version=$BUILD_VERSION --no-restore
44+
45+
- name: Test
46+
run: dotnet test -p:Configuration=$BUILD_CONFIG --no-restore --no-build --verbosity normal --collect:"XPlat Code Coverage"
47+
48+
- name: Codecov
49+
uses: codecov/[email protected]
50+
with:
51+
token: ${{ secrets.CODECOVACCESSTOKEN }} # not required for public repos
52+
53+
- name: Setup NuGet
54+
uses: NuGet/setup-nuget@v1
55+
56+
- name: Publish NuGet
57+
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGETORGAPI}}

0 commit comments

Comments
 (0)