-
-
Notifications
You must be signed in to change notification settings - Fork 20
108 lines (93 loc) · 3.04 KB
/
test.yml
File metadata and controls
108 lines (93 loc) · 3.04 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Test
on:
pull_request:
branches:
- main
jobs:
Test:
runs-on: windows-latest
env:
DOTNET_INSTALL_DIR: "D:/tools/dotnet"
DOTNET_ROOT: "D:/tools/dotnet"
NUGET_PACKAGES: "D:/.nuget/packages"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Install dependencies
run: dotnet restore --locked-mode
- name: Test architecture
run: dotnet test -c Debug --filter Mode=Debug
- name: Test others
run: dotnet test -c Release --filter Mode!=Debug
Version:
runs-on: ubuntu-latest
needs: Test
permissions:
contents: write
outputs:
version: ${{ steps.semvers.outputs.patch }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get Previous tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v2
with:
fallback: 1.0.0
- name: Get next version
id: semvers
uses: WyriHaximus/github-action-next-semvers@v1.2.1
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: Create tag
uses: rickstaa/action-create-tag@v1.7.2
with:
tag: ${{ steps.semvers.outputs.patch }}
tag_exists_error: false
message: TBS-${{ steps.semvers.outputs.patch }}
Build:
runs-on: windows-latest
needs: Version
env:
DOTNET_INSTALL_DIR: "D:/tools/dotnet"
DOTNET_ROOT: "D:/tools/dotnet"
NUGET_PACKAGES: "D:/.nuget/packages"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Install dependencies
run: dotnet restore --locked-mode
- name: Publish
run: dotnet publish WPFUI -c Release --no-restore --self-contained -p:PublishSingleFile=true -p:AssemblyVersion=${{needs.version.outputs.version}} -p:RunAnalyzersDuringBuild=True
- name: Upload a Build Artifact
uses: actions/upload-artifact@v7
with:
name: TBS-${{needs.version.outputs.version}}
path: WPFUI\bin\Release\net8.0-windows10.0.19041.0\win-x64\publish\
if-no-files-found: error
Comment:
needs: [Build, Version]
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Comment PR
uses: thollander/actions-comment-pull-request@v3
with:
message: |
Version of this build is ${{needs.version.outputs.version}}
Check download link [here](https://nightly.link/vinaghost/TravianBotSharp/actions/runs/${{ github.run_id }})