-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (41 loc) · 1.31 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
name: Build and Pack Only
on:
push:
branches: ["develop"]
pull_request:
branches: ["develop"]
workflow_dispatch:
env:
VERSION: 0.0.0
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set Version Variable from tag
if: ${{ github.ref_type == 'tag' }}
env:
TAG: ${{ github.ref_name }}
run: echo "VERSION=${TAG#v}-beta${{github.run_number}}" >> $GITHUB_ENV
- name: Set Version Variable from tag
if: ${{ !(github.ref_type == 'tag') }}
env:
TAG: ${{ github.ref_name }}
run: echo "VERSION=0.1.0-pre${{github.run_number}}" >> $GITHUB_ENV
- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Setup .NET 7
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
- name: Setup .NET 8
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Build project
run: dotnet build src\HC.PageNotFoundManager\HC.PageNotFoundManager.csproj --configuration Release /p:Version=$VERSION
- name: Pack project
run: dotnet pack --output --no-build nupkgs /p:PackageVersion=$VERSION .\src\PageNotFoundManager.sln