Skip to content

Commit

Permalink
GIthubCI: extract installing GTK workload script
Browse files Browse the repository at this point in the history
Extract commands for installing GTK workload into
install_gtk_workload.sh script.
  • Loading branch information
webwarrior-ws committed Nov 21, 2024
1 parent 308536e commit 0d40ad2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/build-gtk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,7 @@ jobs:
with:
dotnet-version: ${{ env.DotnetVersion }}
- 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), so download and uzip mainfest file manually
dotnet nuget add source --name nuget.org "https://api.nuget.org/v3/index.json"
wget https://www.nuget.org/api/v2/package/gtksharp.net.sdk.gtk.manifest-${{ env.GtkSharpManifestVersion }}/$GtkSharpVersion -O gtksharp.net.sdk.gtk.manifest-${{ env.GtkSharpManifestVersion }}.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.GtkSharpManifestVersion }}.nupkg "data/*" -d $WORKLOAD_MANIFEST_DIR/
rm gtksharp.net.sdk.gtk.manifest-${{ env.GtkSharpManifestVersion }}.nupkg
chmod 764 $WORKLOAD_MANIFEST_DIR/*
dotnet workload search
dotnet workload install gtk --skip-manifest-update
run: ./install_gtk_workload.sh
- name: Build MAUI
run: |
mv Directory.Build.Override.props.in Directory.Build.Override.props
Expand Down
15 changes: 15 additions & 0 deletions install_gtk_workload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -euxo pipefail

# For some reason automatic workload manifest detection doesn't work (see https://github.com/GtkSharp/GtkSharp/issues/355#issuecomment-1446262239), so download and uzip mainfest file manually
dotnet nuget add source --name nuget.org "https://api.nuget.org/v3/index.json"
wget https://www.nuget.org/api/v2/package/gtksharp.net.sdk.gtk.manifest-$GtkSharpManifestVersion/$GtkSharpVersion -O gtksharp.net.sdk.gtk.manifest-$GtkSharpManifestVersion.nupkg
DOTNET_DIR=/home/runner/.dotnet
WORKLOAD_MANIFEST_DIR=$DOTNET_DIR/sdk-manifests/$DotnetVersion/gtksharp.net.sdk.gtk
mkdir -p $WORKLOAD_MANIFEST_DIR
unzip -j gtksharp.net.sdk.gtk.manifest-$GtkSharpManifestVersion.nupkg "data/*" -d $WORKLOAD_MANIFEST_DIR/
rm gtksharp.net.sdk.gtk.manifest-$GtkSharpManifestVersion.nupkg
chmod 764 $WORKLOAD_MANIFEST_DIR/*
dotnet workload search
dotnet workload install gtk --skip-manifest-update

0 comments on commit 0d40ad2

Please sign in to comment.