diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f25a0e8b3..2316367fb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,6 +9,9 @@ on: schedule: - cron: "0 0 * * *" +env: + GtkSharpVersion: 3.24.24.95 + DotNetVersionForMauiGtk: 6.0.400 # FIXME: figure out why we need to clean after make if we # want 'make strict' target to really happen without @@ -209,9 +212,6 @@ jobs: linux-github--dotnet-and-mono: runs-on: ubuntu-22.04 - env: - GtkSharpVersion: 3.24.24.95 - DotnetVersion: 6.0.400 steps: - uses: actions/checkout@v1 with: @@ -220,22 +220,8 @@ jobs: uses: actions/setup-dotnet@v1.7.2 with: dotnet-version: ${{ env.DotnetVersion }} - - name: Install gtk workload - run: | - 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: Add Maui Nuget source - run: | - cd dependencies/maui - dotnet nuget add source --name nuget https://api.nuget.org/v3/index.json + - name: Install gtk workload & add Maui Nuget source + run: ./prepare_maui_gtk.sh - name: install missing dependencies run: sudo apt install --yes fsharp nunit-console - name: check mono version @@ -637,9 +623,6 @@ jobs: - conventions runs-on: ubuntu-22.04 - env: - GtkSharpVersion: 3.24.24.95 - DotnetVersion: 6.0.400 steps: - uses: actions/checkout@v1 - name: Install snap tools diff --git a/scripts/prepare_maui_gtk.sh b/scripts/prepare_maui_gtk.sh new file mode 100644 index 000000000..333746ed7 --- /dev/null +++ b/scripts/prepare_maui_gtk.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -euxo pipefail + +# Install gtk workload +wget -O gtksharp.net.sdk.gtk.manifest-$DotNetVersionForMauiGtk.nupkg https://globalcdn.nuget.org/packages/gtksharp.net.sdk.gtk.manifest-$DotNetVersionForMauiGtk.$GtkSharpVersion.nupkg +DOTNET_DIR=~/.dotnet +WORKLOAD_MANIFEST_DIR=$DOTNET_DIR/sdk-manifests/$DotNetVersionForMauiGtk/gtksharp.net.sdk.gtk +mkdir -p $WORKLOAD_MANIFEST_DIR/ +unzip -j gtksharp.net.sdk.gtk.manifest-$DotNetVersionForMauiGtk.nupkg "data/*" -d $WORKLOAD_MANIFEST_DIR/ +rm gtksharp.net.sdk.gtk.manifest-$DotNetVersionForMauiGtk.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 + +#Add Maui Nuget source +cd dependencies/maui +dotnet nuget add source --name nuget https://api.nuget.org/v3/index.json +cd ../.. diff --git a/scripts/snap_build_maui.sh b/scripts/snap_build_maui.sh index dac2136d2..59e7b9788 100755 --- a/scripts/snap_build_maui.sh +++ b/scripts/snap_build_maui.sh @@ -1,22 +1,8 @@ #!/usr/bin/env bash set -euxo pipefail -# Install gtk workload -wget -O gtksharp.net.sdk.gtk.manifest-$DotnetVersion.nupkg https://globalcdn.nuget.org/packages/gtksharp.net.sdk.gtk.manifest-$DotnetVersion.$GtkSharpVersion.nupkg -DOTNET_DIR=~/.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-$DotnetVersion.nupkg "data/*" -d $WORKLOAD_MANIFEST_DIR/ -rm gtksharp.net.sdk.gtk.manifest-$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 - -#Add Maui Nuget source -cd dependencies/maui -dotnet nuget add source --name nuget https://api.nuget.org/v3/index.json -cd ../.. +# Install gtk workload and add Maui nuget source +./prepare_maui_gtk.sh # Build GWallet MAUI Gtk project ./configure.sh