Skip to content

Commit 32835e6

Browse files
committed
WIP Workflow
1 parent da277c9 commit 32835e6

File tree

4 files changed

+94
-67
lines changed

4 files changed

+94
-67
lines changed

.github/workflows/build_and_test.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Build, test and deploy
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
# Stop wasting time caching packages
9+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
10+
# Disable sending usage data to Microsoft
11+
DOTNET_CLI_TELEMETRY_OPTOUT: true
12+
13+
# Official NuGet Feed settings
14+
NUGET_FEED: https://api.nuget.org/v3/index.json
15+
16+
jobs:
17+
build_test_deploy:
18+
runs-on: ubuntu-20.04
19+
defaults:
20+
run:
21+
working-directory: ./source
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Setup GitVersion
30+
uses: gittools/actions/gitversion/[email protected]
31+
with:
32+
versionSpec: '5.8.1'
33+
34+
- name: Determine Version
35+
id: gitversion
36+
uses: gittools/actions/gitversion/[email protected]
37+
38+
- name: Setup .NET
39+
uses: actions/setup-dotnet@v1
40+
with:
41+
dotnet-version: 6.0.x
42+
43+
- name: Restore dependencies
44+
run: dotnet restore
45+
46+
- name: Build Test version
47+
run: dotnet build --configuration Release --no-restore
48+
49+
- name: Run Tests
50+
run: dotnet test --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --settings MyPackage.Tests/coverlet.runsettings
51+
52+
- name: Build Release version
53+
run: dotnet build --no-restore --configuration Release /p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:InformationalVersion=${{ steps.gitversion.outputs.Sha }}
54+
55+
- name: Pack
56+
run: dotnet pack --no-build --output ./output --configuration Release /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
57+
58+
- name: Upload Package to job as artificat
59+
uses: actions/upload-artifact@v2
60+
with:
61+
name: "Marten.AspNetCore.Identity-${{ steps.gitversion.outputs.nuGetVersionV2 }}"
62+
path: ./output/*.nupkg
63+
64+
- name: Upload Package to release
65+
if: contains(github.ref, 'main')
66+
uses: svenstaro/upload-release-action@v1-release
67+
with:
68+
repo_token: ${{ secrets.GITHUB_TOKEN }}
69+
file_glob: true
70+
file: ./output/*.nupkg
71+
tag: "${{ steps.gitversion.outputs.fullSemVer }}"
72+
overwrite: true
73+
74+
- name: Upload Package to nuget
75+
if: contains(github.ref, 'main')
76+
run: dotnet nuget push ./output/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key ${{ secrets.NUGET_KEY }}

.github/workflows/create_release.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<RunSettings>
3+
<DataCollectionRunSettings>
4+
<DataCollectors>
5+
<DataCollector friendlyName="XPlat code coverage">
6+
<Configuration>
7+
<Format>json,cobertura,lcov,teamcity,opencover</Format>
8+
<Exclude>[Marten.AspNetCore.Identity.Tests]*,[Marten.IdentityExampleApp]*</Exclude>
9+
<SingleHit>false</SingleHit>
10+
<UseSourceLink>false</UseSourceLink>
11+
<IncludeTestAssembly>false</IncludeTestAssembly>
12+
<SkipAutoProps>false</SkipAutoProps>
13+
<DeterministicReport>false</DeterministicReport>
14+
</Configuration>
15+
</DataCollector>
16+
</DataCollectors>
17+
</DataCollectionRunSettings>
18+
</RunSettings>

0 commit comments

Comments
 (0)