-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 1.85 KB
/
release.yaml
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
on:
workflow_dispatch:
push:
branches:
- '*'
paths-ignore:
- CHANGELOG.md
pull_request:
types: [opened, reopened, synchronize]
paths-ignore:
- CHANGELOG.md
name: Create Release
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: .NET Build
run: dotnet build -c Release
- name: .NET Test
run: dotnet test -c Release --collect:"XPlat Code Coverage"
- name: Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.cobertura.xml
fail_ci_if_error: true
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
id: semantic
with:
dry_run: true
extra_plugins: |
@semantic-release/changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: .NET Pack
working-directory: src/YamlDotNet.System.Text.Json
run: dotnet pack -c Release -p:Version=${{ (steps.semantic.outputs.new_release_published && steps.semantic.outputs.new_release_version) || '0.0.1' }}
- name: .NET NuGet Push
if: steps.semantic.outputs.new_release_published == 'true'
working-directory: src/YamlDotNet.System.Text.Json/bin/Release
run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
- name: Semantic Release
if: steps.semantic.outputs.new_release_published == 'true'
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: NuGet Package
path: src/**/*.nupkg