forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (53 loc) · 2.77 KB
/
build-gtk.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
name: Build Controls.Sample.Gtk
on: [push, pull_request]
jobs:
build_and_test:
name: Build & Test
runs-on: ubuntu-22.04
env:
GtkSharpVersion: 3.24.24.95
DotnetVersion: 6.0.400
steps:
- name: Checkout MAUI repo
uses: actions/checkout@v2
# We also tested using 6.0.111 for both projects
# but MAUI failed to build on this version with this error:
# Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
# So instead we use 6.0.400
- name: Setup .NET SDK ${{ env.DotnetVersion }}
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: ${{ env.DotnetVersion }}
- name: Add nuget source
run: dotnet nuget add source --name nuget https://api.nuget.org/v3/index.json
- name: Install gtk workload
run: |
# For some reason automatic workload manifest detection doesn't work (see https://github.com/GtkSharp/GtkSharp/issues/355#issuecomment-1446262239 and https://github.com/GtkSharp/GtkSharp/issues/403), so download and unzip mainfest file manually
wget -O gtksharp.net.sdk.gtk.manifest-${{ env.DotnetVersion }}.nupkg https://globalcdn.nuget.org/packages/gtksharp.net.sdk.gtk.manifest-${{ env.DotnetVersion }}.$GtkSharpVersion.nupkg
DOTNET_DIR=/home/runner/.dotnet
WORKLOAD_MANIFEST_DIR=$DOTNET_DIR/sdk-manifests/${{ env.DotnetVersion }}/gtksharp.net.sdk.gtk
mkdir -p $WORKLOAD_MANIFEST_DIR/
unzip -j gtksharp.net.sdk.gtk.manifest-${{ env.DotnetVersion }}.nupkg "data/*" -d $WORKLOAD_MANIFEST_DIR/
rm gtksharp.net.sdk.gtk.manifest-${{ env.DotnetVersion }}.nupkg
# otherwise we get System.UnauthorizedAccessException: Access to the path '/home/runner/.dotnet/sdk-manifests/6.0.300/gtksharp.net.sdk.gtk/WorkloadManifest.json' is denied.
chmod 764 $WORKLOAD_MANIFEST_DIR/*
dotnet workload search
dotnet workload install gtk --skip-manifest-update
- name: Build MAUI
run: |
dotnet build src/Controls/src/SourceGen/Controls.SourceGen.csproj
dotnet build Microsoft.Maui.Gtk.slnf
- name: Build ZXing.Net.Maui
run: |
dotnet build ./src/ZXing.Net.Maui/ZXing.Net.MAUI/ZXing.Net.MAUI.csproj --framework=net6.0-gtk
dotnet build ./src/ZXing.Net.Maui/ZXing.Net.MAUI.Controls/ZXing.Net.MAUI.Controls.csproj --framework=net6.0-gtk
dotnet-format:
needs: build_and_test
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Run dotnet format
run: |
dotnet format whitespace ./src --folder --exclude Templates/src --exclude ZXing.Net.Maui
git diff --exit-code