forked from Blazor-Diagrams/Blazor.Diagrams
-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (52 loc) · 1.61 KB
/
release.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
name: Create release
# On push to master branch. i.e. when we merge a PR.
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
PACKAGE_PATH: /home/runner/work/Blazor.Diagrams/Blazor.Diagrams/src/Blazor.Diagrams/bin/Release/*.nupkg
jobs:
build:
name: Build - Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
3.1.x
# Finds the latest release and increases the version
- name: Get next version
uses: reecetech/[email protected]
id: version
with:
scheme: semver
increment: patch
- name: Install version tool
run: dotnet tool install dotnetCampus.TagToVersion -g --version 1.0.11
# Writes the new version number to build/Version.props
- name: Set version
run: dotnet TagToVersion -t ${{ steps.version.outputs.version }}
- name: Install dependencies
run: dotnet restore
# Pacakge is created on build
- name: Build
run: dotnet build --configuration Release
# Upload package as an atrifact to the GitHub action
- name: Upload packages
uses: actions/upload-artifact@v3
with:
name: package
path: ${{ env.PACKAGE_PATH }}
retention-days: 5
# Create a new release and upload the package to the release
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ env.PACKAGE_PATH }}
tag_name: ${{ steps.version.outputs.version }}