generated from Stelzi79/DotNetTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (53 loc) · 1.87 KB
/
test_pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# This is a basic workflow to help you get started with Actions
name: Test PRs
# Controls when the workflow will run
on:
pull_request:
branches: [develop]
types: [synchronize, opened, reopened, ready_for_review]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.100
- name: run minver
id: version
uses: stelzi79/[email protected]
with:
auto-increment: minor
default-pre-release-phase: preview
verbosity: info
- name: Test
run: |
dotnet test --configuration Release --no-build
working-directory: ./src
env:
MinVerVersionOverride: ${{ steps.version.outputs.version }}-${{ github.run_id}}-${{ github.run_number}}-${{ github.run_attempt}}
- name: Pack
run: |
dotnet restore
dotnet msbuild -t:Replace -t:MinVer
dotnet pack --configuration Release
working-directory: ./src
env:
MinVerVersionOverride: ${{ steps.version.outputs.version }}-${{ github.run_id}}-${{ github.run_number}}-${{ github.run_attempt}}
- name: Publish the package to GPR
run: dotnet nuget push .vs/bin/**/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://nuget.pkg.github.com/Stelzi79/index.json --skip-duplicate
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}