-
Notifications
You must be signed in to change notification settings - Fork 19
118 lines (102 loc) · 3.01 KB
/
dotnetcore.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
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
name: .NET Build and Test
on:
push:
branches:
- "develop"
pull_request:
branches:
- "*"
env:
DOTNET_VERSION: '7.0.x'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Format check
run: |
dotnet format --verify-no-changes
- name: Test
run: |
dotnet test /p:CollectCoverage=true
build-windows:
name: Build Windows
runs-on: windows-latest
steps:
# Setup
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Build
- name: Publish
run: |
dotnet publish --configuration Release --runtime win-x64 --self-contained true --property PublishDir=publish
# Upload
- name: Upload Build
uses: actions/upload-artifact@v3
with:
name: StationHub-win-x64
path: D:\a\stationhub\stationhub\UnitystationLauncher\publish\
build-macos:
name: Build MacOS
runs-on: ubuntu-latest
steps:
# Setup
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Build
- name: Publish
run: |
dotnet publish --configuration Release --runtime osx-x64 -t:BundleApp -p:RuntimeIdentifier=osx-x64 -p:UseAppHost=true --self-contained true --property PublishDir=~/publish \
&& sudo chmod +x ~/publish/StationHub.app/Contents/MacOS/StationHub \
&& cd ~/publish \
&& tar -cvf ~/publish/StationHub.tar StationHub.app
# Upload
- name: Upload Build
uses: actions/upload-artifact@v3
with:
name: StationHub-osx-x64
path: ~/publish/StationHub.tar
build-linux:
name: Build Linux
runs-on: ubuntu-latest
steps:
# Setup
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Build
- name: Publish
run: |
dotnet publish --configuration Release --runtime linux-x64 --self-contained true --property PublishDir=~/publish
# Upload
- name: Upload Build
uses: actions/upload-artifact@v3
with:
name: StationHub-linux-x64
path: ~/publish
build-flatpak:
name: Build Linux Flatpak
runs-on: ubuntu-latest
steps:
# Setup
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Build
- name: Test Flatpak Build
run: |
dotnet publish --framework net7.0 --runtime linux-x64 --configuration Release --self-contained true /p:DefineConstants="FLATPAK" /p:DisableBeauty=true