-
-
Notifications
You must be signed in to change notification settings - Fork 1
96 lines (87 loc) · 2.73 KB
/
build.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
name: Build SnapX
on:
push:
branches:
- "**"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
paths-ignore:
- "**/*.md"
- "**/*.spec"
- "**/*.gitignore"
- "**/*.gitattributes"
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ${{matrix.os}}
timeout-minutes: 65
strategy:
fail-fast: false
matrix:
os: [ ubuntu-24.04, ubuntu-24.04-arm, macos-latest, macos-13, windows-latest ]
configuration:
- Release
- Debug
env:
SOLUTION_FILE_PATH: SnapX.sln
ASSEMBLY_INFO_PATH: Directory.build.props
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Cache .NET NuGet packages
uses: actions/cache@v4
with:
path: |
~/.nuget/packages
C:\Users\runner\.nuget\packages
key: ${{ runner.os }}-${{ runner.arch }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore --locked-mode
# Needed for offline building :3
- name: Upload Source With Dependencies
if: matrix.configuration == 'Debug' && runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: SnapX-Vendored-Source-${{ runner.arch }}
path: .
include-hidden-files: false
compression-level: 9
- name: Publish
if: matrix.os == 'windows-latest'
run: |
./build.ps1 --configuration ${{ matrix.configuration }}
- name: Publish
if: matrix.os != 'windows-latest'
run: ./build.sh --configuration ${{ matrix.configuration }}
- name: Upload Publish artifact (CLI)
uses: actions/upload-artifact@v4
with:
name: SnapX-CLI-${{ matrix.configuration }}-${{ runner.os }}-${{ runner.arch }}
path: "Output/snapx"
compression-level: 9
if-no-files-found: error
- name: Upload Publish artifact (Avalonia)
uses: actions/upload-artifact@v4
with:
name: SnapX-Avalonia-${{ matrix.configuration }}-${{ runner.os }}-${{ runner.arch }}
path: "Output/snapx-ui"
compression-level: 9
if-no-files-found: error
- name: Upload Publish artifact (GTK4)
uses: actions/upload-artifact@v4
if: runner.os == 'Linux'
with:
name: SnapX-GTK4-${{ matrix.configuration }}-${{ runner.os }}-${{ runner.arch }}
path: "Output/snapx-gtk"
compression-level: 9
if-no-files-found: error