Skip to content

Commit

Permalink
GithubCI: use nuget source instead of github
Browse files Browse the repository at this point in the history
Use nuget source for downloading the gtksharp manifest
instead of using github packages. This way there won't
be any need to use github authentication and we can use
latest nuget packages.
  • Loading branch information
parhamsaremi committed May 25, 2023
1 parent f4d1f43 commit 8bcbc2a
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,36 +126,32 @@ jobs:
linux22-github:
runs-on: ubuntu-22.04
env:
GtkSharpVersion: 3.24.24.77-develop
DotnetVersion: 6.0.300
GtkSharpVersion: 3.24.24.95
DotnetVersion: 6.0.400
steps:
- uses: actions/checkout@v1
with:
submodules: true
# 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.300
- name: Setup .NET SDK ${{ env.DotnetVersion }}
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: ${{ env.DotnetVersion }}
- name: Install gtk workload
run: |
dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/GtkSharp/index.json"
# 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
wget --user ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} https://nuget.pkg.github.com/GtkSharp/download/gtksharp.net.sdk.gtk.manifest-${{ env.DotnetVersion }}/$GtkSharpVersion/gtksharp.net.sdk.gtk.manifest-${{ env.DotnetVersion }}.nupkg
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 --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/GtkSharp/index.json"
dotnet nuget add source --name nuget https://api.nuget.org/v3/index.json
- name: install missing dependencies
run: sudo apt install --yes fsharp nunit-console
- name: check mono version
Expand Down

0 comments on commit 8bcbc2a

Please sign in to comment.