Skip to content

Commit c194a22

Browse files
committed
ci: upload artifacts from CI builds
1 parent c6c3579 commit c194a22

File tree

1 file changed

+107
-18
lines changed

1 file changed

+107
-18
lines changed
Lines changed: 107 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
name: GCM
1+
name: ci
22

33
on:
44
workflow_dispatch:
55
push:
6-
branches: [ main, linux ]
6+
branches: [ main ]
77
pull_request:
8-
branches: [ main, linux ]
8+
branches: [ main ]
99

1010
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
1817

1918
steps:
2019
- uses: actions/checkout@v3
@@ -27,17 +26,107 @@ jobs:
2726
- name: Install dependencies
2827
run: dotnet restore
2928

30-
- name: Build Windows
31-
if: contains(matrix.os, 'windows')
29+
- name: Build
3230
run: dotnet build --configuration WindowsRelease
3331

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+
uses: actions/[email protected]
63+
with:
64+
dotnet-version: 6.0.201
65+
66+
- name: Install dependencies
67+
run: dotnet restore
68+
69+
- name: Build
3670
run: dotnet build --configuration LinuxRelease
3771

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+
uses: actions/[email protected]
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 }}
41115
42116
- 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

Comments
 (0)