-
Notifications
You must be signed in to change notification settings - Fork 9
64 lines (60 loc) · 2.23 KB
/
build.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
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
# Prepare
- uses: actions/checkout@v4
with:
fetch-depth: 0
show-progress: false
- uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.12.x'
- uses: gittools/actions/gitversion/[email protected]
id: gitversion
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
# Build
- name: Build (pre-release)
if: github.ref_type != 'tag'
run: ./build.sh ${{steps.gitversion.outputs.nuGetVersion}}-${{steps.gitversion.outputs.shortSha}}
- name: Build (release)
if: github.ref_type == 'tag'
run: ./build.sh ${{steps.gitversion.outputs.nuGetVersion}}
- name: Report test results
if: always()
uses: dorny/test-reporter@v1
with:
name: Test Report
reporter: dotnet-trx
path: src/UnitTests/TestResults/*.trx
# Release
- name: Create GitHub Release
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v2
- name: Post-release commit
if: github.ref_type == 'tag'
run: |
git config user.name github-actions
git config user.email [email protected]
git checkout -q master
git commit --all -m "Automatic post-release commit"
git push -q
# Publish
- name: Publish documentation
if: github.ref_type == 'tag'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{github.token}}
force_orphan: true
publish_dir: artifacts/Documentation
cname: openservicebroker.typedrest.net
- name: Publish packages (GitHub)
if: github.event_name == 'push' && !startsWith(github.ref_name, 'renovate/')
run: dotnet nuget push artifacts/Release/*.nupkg --source https://nuget.pkg.github.com/${{github.repository_owner}}/index.json --api-key ${{github.token}} --no-symbols --skip-duplicate
- name: Publish packages (NuGet.org)
if: github.ref_type == 'tag'
run: dotnet nuget push artifacts/Release/*.nupkg --source nuget.org --api-key ${{secrets.NUGET_API_KEY}}