Skip to content

Commit a59997a

Browse files
committed
Add build github action
1 parent 19e3d28 commit a59997a

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/build.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ "master" ]
7+
pull_request:
8+
9+
jobs:
10+
11+
build:
12+
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
runs-on: windows-latest
18+
19+
env:
20+
Solution_Path: ContextMenuManager.sln
21+
Project_Path: ContextMenuManager\ContextMenuManager.csproj
22+
23+
steps:
24+
25+
# Checkout codes
26+
- name: Checkout
27+
uses: actions/checkout@v5
28+
29+
# Install the .NET Core workload
30+
# - name: Setup .NET
31+
# uses: actions/setup-dotnet@v4
32+
# with:
33+
# dotnet-version: |
34+
# 9.0.x
35+
36+
# Restore dependencies for entire solution
37+
- name: Restore dependencies
38+
run: dotnet restore ${{ env.Solution_Path }}
39+
40+
# Build the entire solution
41+
- name: Build
42+
run: dotnet build ${{ env.Solution_Path }} --configuration Release
43+
44+
# Execute all unit tests in the solution
45+
- name: Execute unit tests
46+
run: dotnet test ${{ env.Solution_Path }} --configuration Release --no-build
47+
48+
# Run the build task
49+
- name: Run build task
50+
run: dotnet run --project ${{ env.Project_Path }}
51+
52+
# Upload the Build package
53+
- name: Upload Build package
54+
uses: actions/upload-artifact@v4
55+
with:
56+
path: |
57+
ContextMenuManager/bin/Release/ContextMenuManager.exe
58+
compression-level: 0

0 commit comments

Comments
 (0)