-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (51 loc) · 1.82 KB
/
dotnet.yml
File metadata and controls
62 lines (51 loc) · 1.82 KB
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
name: release
on:
workflow_dispatch:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
env:
PROJ_ID: Enhanced.ComponentModel
PROJ_PATH: src\Enhanced.ComponentModel\Enhanced.ComponentModel.csproj
steps:
- uses: actions/checkout@v2
- name: Bump version
id: bump_version
uses: mathieudutour/github-tag-action@v5.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: release/v
create_annotated_tag: false
dry_run: true
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore dependencies
run: dotnet restore $PROJ_PATH
- name: Build
run: dotnet build $PROJ_PATH --no-restore -c release -p:version=${{ steps.bump_version.outputs.new_version }}
- name: Pack
run: dotnet pack $PROJ_PATH --no-build --include-symbols -o out -c release -p:version=${{ steps.bump_version.outputs.new_version }}
- name: Push
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push out/$PROJ_ID.${{ steps.bump_version.outputs.new_version }}.nupkg -s nuget.org -k $NUGET_API_KEY
- name: Tag version
id: tag_version
uses: mathieudutour/github-tag-action@v5.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: release/v
create_annotated_tag: true
dry_run: false
- name: Create a GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_version }}
artifact: out/$PROJ_ID.${{ steps.bump_version.outputs.new_version }}.nupkg
body: ${{ steps.tag_version.outputs.changelog }}