Merge pull request #101 from jsuarezruiz/housekeeping/fix-codeformatting #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Controls.Sample.Gtk | |
on: [push, pull_request] | |
jobs: | |
build_and_test: | |
name: Build & Test | |
runs-on: ubuntu-24.04 | |
env: | |
GtkSharpVersion: 3.24.24.117-develop | |
GtkSharpManifestVersion: 8.0.200 | |
DotnetVersion: 8.0.200 | |
steps: | |
- name: Checkout MAUI repo | |
uses: actions/checkout@v4 | |
- name: Setup .NET SDK ${{ env.DotnetVersion }} | |
uses: actions/setup-dotnet@v4 | |
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=/usr/share/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 | |
- name: Generate pre-release version suffix | |
run: dotnet fsi nugetPreRelease.fsx "" > PreReleaseVersionSuffix.txt | |
- name: Build MAUI | |
run: | | |
sed -i 's/_IncludeAndroid>true/_IncludeAndroid>/g' Directory.Build.Override.props | |
dotnet build Microsoft.Maui.BuildTasks.slnf | |
dotnet build -c Release Microsoft.Maui.Gtk.slnf | |
- name: Pack MAUI | |
run: dotnet pack Microsoft.Maui.Gtk.Packages.slnf | |
- name: Upload binaries to nuget (if tag or main branch, and nugetKey is present) | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NUGET_KEY: ${{ secrets.NUGET_KEY }} | |
if: ${{ env.NUGET_KEY != '' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }} | |
run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
dotnet-format: | |
needs: build_and_test | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Run dotnet format | |
run: | | |
# remark: doesnt work, alwasy fails: | |
# dotnet format whitespace ./src --folder --exclude Templates/src | |
git diff --exit-code |