forked from BeyondDimension/SteamTools
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (126 loc) · 6.62 KB
/
dotnet.yml
File metadata and controls
155 lines (126 loc) · 6.62 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Build
env:
ProjectName: Steam++
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
configuration: [ Debug, Release ]
os: [ windows-latest, macOS-latest, ubuntu-latest ]
# rid: [ fd-win-x64, win-x64, osx-x64, linux-x64,linux-arm64 ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install macOS SDK(macOS)
if: matrix.os == 'macOS-latest'
run: sudo dotnet workload install macos
- name: Install macOS SDK(Windows)
if: matrix.os == 'windows-latest'
run: dotnet workload install macos
- name: Install Maui(Windows)
if: matrix.os == 'windows-latest'
run: dotnet workload install maui
- name: Verify dotnet info
run: dotnet --info
- name: Checkout Credentials repository
if: ${{ matrix.os == 'windows-latest' && !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
uses: actions/checkout@v2
with:
repository: SteamTools-Team/Credentials
token: ${{ secrets.REPO_TOKEN }}
path: ./Credentials
- name: Copy pfx and snk To Source
if: ${{ matrix.os == 'windows-latest' && !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
run: |
copy ".\Credentials\*.pfx" .
copy ".\Credentials\*.snk" .
dir *.pfx -s
- name: dotnet restore SteamToolsV2+.sln
if: matrix.os == 'windows-latest'
run: dotnet restore ./SteamToolsV2+.sln
- name: dotnet restore SteamToolsV2+.Linux.sln
if: matrix.os == 'ubuntu-latest'
run: dotnet restore ./SteamToolsV2+.Linux.slnf
- name: dotnet restore SteamToolsV2+.Mac.sln
if: matrix.os == 'macOS-latest'
run: dotnet restore ./SteamToolsV2+.Mac.slnf
- name: Build AvaloniaApp ${{ matrix.configuration }}
run: dotnet build ./src/ST.Client.Desktop.Avalonia.App/ST.Client.Avalonia.App.csproj -c "${{ matrix.configuration }}"
- name: Run CommonUnit
run: dotnet test ./tests/Common.UnitTest/Common.UnitTest.csproj -c "${{ matrix.configuration }}"
- name: Run ST.Client.UnitTest
run: dotnet test ./tests/ST.Client.UnitTest/ST.Client.UnitTest.csproj -c "${{ matrix.configuration }}"
- name: Run ST.Client.Desktop.UnitTest
run: dotnet test ./tests/ST.Client.Desktop.UnitTest/ST.Client.Desktop.UnitTest.csproj -c "${{ matrix.configuration }}"
# - name: dotnet ST.Client.Desktop.UnitTest test
# if: matrix.os != 'windows-latest'
# run: dotnet test ./tests/ST.Client.Desktop.UnitTest/ST.Client.Desktop.UnitTest.csproj
- name: Get Short CommitId
if: ${{ matrix.os == 'windows-latest' && !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
shell: pwsh
run: Write-Output "GITHUB_SHA_SHORT=$(${env:GITHUB_SHA}.Substring(0,7))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build ST.Tools.Publish Release
if: ${{ matrix.os == 'windows-latest' && !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
run: dotnet build ./src/ST.Tools.Publish/ST.Tools.Publish.csproj -c Release
- name: Build ${{ matrix.configuration }} & Package All
if: ${{ matrix.os == 'windows-latest' && !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
shell: pwsh
run: .\packaging\build.ps1 -configuration ${{ matrix.configuration }}
- name: All Package
if: ${{ matrix.os == 'windows-latest' && !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
shell: pwsh
run: |
$dev = $(if ('${{ matrix.configuration }}' -eq 'Debug') {"-dev"})
$pexe=".\src\ST.Tools.Publish\bin\Release\net6.0\p.exe"
& $pexe hp $dev
& $pexe sta $dev
& $pexe 7z -buildpackage ${env:GITHUB_SHA_SHORT} $dev
- name: Upload fd-win-x64 App ${{ matrix.configuration }}
continue-on-error: true
if: ${{ matrix.os == 'windows-latest' && !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
uses: actions/upload-artifact@v2
with:
name: '[${{ matrix.configuration }}]${{ env.ProjectName }}_win_x64_fde_${{ env.GITHUB_SHA_SHORT }}'
path: src\ST.Client.Desktop.Avalonia.App\bin\${{ matrix.configuration }}\Publish\${{ env.ProjectName }}_win_x64_fde_${{ env.GITHUB_SHA_SHORT }}.7z
- name: Upload win-x64 App ${{ matrix.configuration }}
continue-on-error: true
if: ${{ matrix.os == 'windows-latest' && !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
uses: actions/upload-artifact@v2
with:
name: '[${{ matrix.configuration }}]${{ env.ProjectName }}_win_x64_${{ env.GITHUB_SHA_SHORT }}'
path: src\ST.Client.Desktop.Avalonia.App\bin\${{ matrix.configuration }}\Publish\${{ env.ProjectName }}_win_x64_${{ env.GITHUB_SHA_SHORT }}.7z
- name: Upload macos-x64 App ${{ matrix.configuration }}
continue-on-error: true
if: ${{ matrix.os == 'windows-latest' && !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
uses: actions/upload-artifact@v2
with:
name: '[${{ matrix.configuration }}]${{ env.ProjectName }}_macos_x64_${{ env.GITHUB_SHA_SHORT }}'
path: src\ST.Client.Desktop.Avalonia.App\bin\${{ matrix.configuration }}\Publish\${{ env.ProjectName }}_macos_x64_${{ env.GITHUB_SHA_SHORT }}.7z
- name: Upload linux-x64 App ${{ matrix.configuration }}
continue-on-error: true
if: ${{ matrix.os == 'windows-latest' && !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
uses: actions/upload-artifact@v2
with:
name: '[${{ matrix.configuration }}]${{ env.ProjectName }}_linux_x64_${{ env.GITHUB_SHA_SHORT }}'
path: src\ST.Client.Desktop.Avalonia.App\bin\${{ matrix.configuration }}\Publish\${{ env.ProjectName }}_linux_x64_${{ env.GITHUB_SHA_SHORT }}.7z
- name: Upload linux-arm64 App ${{ matrix.configuration }}
continue-on-error: true
if: ${{ matrix.os == 'windows-latest' && !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
uses: actions/upload-artifact@v2
with:
name: '[${{ matrix.configuration }}]${{ env.ProjectName }}_linux_arm64_${{ env.GITHUB_SHA_SHORT }}'
path: src\ST.Client.Desktop.Avalonia.App\bin\${{ matrix.configuration }}\Publish\${{ env.ProjectName }}_linux_arm64_${{ env.GITHUB_SHA_SHORT }}.7z