-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (85 loc) · 3.1 KB
/
Copy pathdotnet.yml
File metadata and controls
102 lines (85 loc) · 3.1 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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Build Perpetuum.Server Service v2
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
jobs:
build:
runs-on: windows-latest
env:
Workspace: ${{ github.workspace }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build src/Perpetuum.ServerService2/Perpetuum.ServerService2.csproj --no-restore --configuration Release --verbosity quiet -p:Platform=x64
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: Perpetuum-Server-v2-${{ github.sha }}
path: ${{ env.Workspace }}/bin/x64/Release/net8.0
if: ${{ github.event_name == 'push'}}
build-admintool-installer:
runs-on: windows-latest
env:
Workspace: ${{ github.workspace }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore -p:Platform=x64
- name: Build AdminTool installer
run: dotnet build src/Perpetuum.AdminToolInstaller/Perpetuum.AdminToolInstaller.wixproj --no-restore --configuration Release --verbosity quiet -p:Platform=x64
- name: Upload AdminTool installer
uses: actions/upload-artifact@v4
with:
name: Perpetuum-AdminTool-Installer-${{ github.sha }}
path: ${{ env.Workspace }}/src/Perpetuum.AdminToolInstaller/bin/x64/Release/en-US/*.msi
if: ${{ github.event_name == 'push' }}
publish-wiki:
runs-on: windows-latest
needs: build
if: github.event_name == 'push'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup .NET 10 (graphify tool requirement)
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Restore dotnet tools
run: dotnet tool restore
- name: Generate codebase report
working-directory: ${{ github.workspace }}
run: dotnet tool run graphify run src -o graphify-out -f report
- name: Publish report to GitHub Wiki
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_SHA: ${{ github.sha }}
run: |
git clone "https://x-access-token:$env:GH_TOKEN@github.com/OpenPerpetuum/PerpetuumServer2.wiki.git" wiki-repo
Copy-Item "graphify-out/GRAPH_REPORT.md" -Destination "wiki-repo/Codebase-Graph.md" -Force
Set-Location wiki-repo
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add "Codebase-Graph.md"
$changes = git status --porcelain
if ($changes) {
git commit -m "Update codebase graph report [$env:COMMIT_SHA]"
git push
} else {
Write-Host "No wiki changes to publish"
}