-
-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (35 loc) · 1.21 KB
/
ci-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
name: CI/CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: Build and Publish
env:
solution-path: './src/GitHub Cost Visualizer.sln'
webproject-path: './src/GitHubCostVisualizer.Web/GitHubCostVisualizer.Web.csproj'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Ensure .NET Installed
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Install GitVersion
run: dotnet tool install --global GitVersion.Tool
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
- name: Restore Packages
run: dotnet restore "${{ env.solution-path }}"
- name: Build
run: dotnet build "${{ env.solution-path }}" --no-restore --configuration Release -p:version=${{ steps.gitversion.outputs.majorMinorPatch }}
- name: Publish
run: dotnet publish "${{ env.webproject-path }}" --runtime win-x64 --configuration Release --output ./App --no-restore -p:version=${{ steps.gitversion.outputs.majorMinorPatch }}