-
Notifications
You must be signed in to change notification settings - Fork 5
73 lines (58 loc) · 2.13 KB
/
master.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: master
on:
push:
branches:
- master
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [
{ framework: netcoreapp3.1, version: 3.1.x },
{ framework: net5.0, version: 5.0.x },
{ framework: net6.0, version: 6.0.x },
]
name: ${{ matrix.dotnet.framework }} – run tests
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet.version }}
- name: Run tests
run: |
dotnet test --configuration Release --framework ${{ matrix.dotnet.framework }} ./src/Dodo.HttpClient.ResiliencePolicies.Tests/Dodo.HttpClient.ResiliencePolicies.Tests.csproj /p:Framework=${{ matrix.dotnet.framework }}
release:
name: Create release
runs-on: ubuntu-latest
needs: run-tests
steps:
- uses: actions/checkout@v1
- name: Extract version
id: extract-version
run: |
version=$(cat ./src/Dodo.HttpClient.ResiliencePolicies/Dodo.HttpClient.ResiliencePolicies.csproj | grep "<VersionPrefix>" | sed -e "s/ *<\/*VersionPrefix>//g")
echo "Package version: $version"
if [ -z "${version// }" ]; then exit 1; fi
echo "::set-output name=package_version::$version"
- name: Extract latest commit message
id: latest-commit
run: |
echo "${{ github.ref }}"
echo "::set-output name=message::$(git log --format=%B -n 1 ${{ github.event.after }})"
- uses: jwalton/gh-find-current-pr@v1
id: find-pr
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.extract-version.outputs.package_version }}
release_name: Release v${{ steps.extract-version.outputs.package_version }}
body: ${{ steps.find-pr.outputs.body || steps.latest-commit.outputs.message }}
draft: true
prerelease: false