1
- name : GCM
1
+ name : ci
2
2
3
3
on :
4
4
workflow_dispatch :
5
5
push :
6
- branches : [ main, linux ]
6
+ branches : [ main ]
7
7
pull_request :
8
- branches : [ main, linux ]
8
+ branches : [ main ]
9
9
10
10
jobs :
11
- validate_gcm :
12
- name : " CI"
13
-
14
- runs-on : ${{ matrix.os }}
15
- strategy :
16
- matrix :
17
- os : [ubuntu-latest, windows-latest, macos-latest]
11
+ # ================================
12
+ # Windows
13
+ # ================================
14
+ windows :
15
+ name : Windows
16
+ runs-on : windows-latest
18
17
19
18
steps :
20
19
- uses : actions/checkout@v3
@@ -27,17 +26,107 @@ jobs:
27
26
- name : Install dependencies
28
27
run : dotnet restore
29
28
30
- - name : Build Windows
31
- if : contains(matrix.os, 'windows')
29
+ - name : Build
32
30
run : dotnet build --configuration WindowsRelease
33
31
34
- - name : Build Linux
35
- if : contains(matrix.os, 'ubuntu')
32
+ - name : Test
33
+ run : |
34
+ dotnet test --verbosity normal --configuration=WindowsRelease
35
+
36
+ - name : Prepare artifacts
37
+ shell : bash
38
+ run : |
39
+ mkdir -p artifacts/bin
40
+ mv out/windows/Installer.Windows/bin/Release/net472/win-x86 artifacts/bin/
41
+ cp out/windows/Installer.Windows/bin/Release/net472/win-x86.sym/* artifacts/bin/win-x86/
42
+ mv out/windows/Installer.Windows/bin/Release/net472/gcm*.exe artifacts/
43
+
44
+ - name : Upload artifacts
45
+ uses : actions/upload-artifact@v3
46
+ with :
47
+ name : win-x86
48
+ path : |
49
+ artifacts
50
+
51
+ # ================================
52
+ # Linux
53
+ # ================================
54
+ linux :
55
+ name : Linux
56
+ runs-on : ubuntu-latest
57
+
58
+ steps :
59
+ - uses : actions/checkout@v3
60
+
61
+ - name : Setup .NET
62
+
63
+ with :
64
+ dotnet-version : 6.0.201
65
+
66
+ - name : Install dependencies
67
+ run : dotnet restore
68
+
69
+ - name : Build
36
70
run : dotnet build --configuration LinuxRelease
37
71
38
- - name : Build macOS
39
- if : contains(matrix.os, 'macos')
40
- run : dotnet build --configuration MacRelease
72
+ - name : Test
73
+ run : |
74
+ dotnet test --verbosity normal --configuration=LinuxRelease
75
+
76
+ - name : Prepare artifacts
77
+ run : |
78
+ mkdir -p artifacts
79
+ mv out/linux/Packaging.Linux/Release/deb/*.deb artifacts/
80
+ mv out/linux/Packaging.Linux/Release/tar/*.tar.gz artifacts/
81
+
82
+ - name : Upload artifacts
83
+ uses : actions/upload-artifact@v3
84
+ with :
85
+ name : linux-x64
86
+ path : |
87
+ artifacts
88
+
89
+ # ================================
90
+ # macOS
91
+ # ================================
92
+ osx :
93
+ name : macOS
94
+ runs-on : macos-latest
95
+ strategy :
96
+ matrix :
97
+ runtime : [ osx-x64, osx-arm64 ]
98
+
99
+ steps :
100
+ - uses : actions/checkout@v3
101
+
102
+ - name : Setup .NET
103
+
104
+ with :
105
+ dotnet-version : 6.0.201
106
+
107
+ - name : Install dependencies
108
+ run : dotnet restore
109
+
110
+ - name : Build
111
+ run : |
112
+ dotnet build src/osx/Installer.Mac/*.csproj \
113
+ --configuration=Release --no-self-contained \
114
+ --runtime=${{ matrix.runtime }}
41
115
42
116
- name : Test
43
- run : dotnet test --verbosity normal
117
+ run : |
118
+ dotnet test --verbosity normal --configuration=MacRelease
119
+
120
+ - name : Prepare artifacts
121
+ run : |
122
+ mkdir -p artifacts/bin
123
+ mv out/osx/Installer.Mac/pkg/Release/payload "artifacts/bin/${{ matrix.runtime }}"
124
+ cp out/osx/Installer.Mac/pkg/Release/payload.sym/* "artifacts/bin/${{ matrix.runtime }}/"
125
+ mv out/osx/Installer.Mac/pkg/Release/gcm*.pkg artifacts/
126
+
127
+ - name : Upload artifacts
128
+ uses : actions/upload-artifact@v3
129
+ with :
130
+ name : ${{ matrix.runtime }}
131
+ path : |
132
+ artifacts
0 commit comments