Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial pass of adding .NET 6 support for sustaining #586

Merged
merged 9 commits into from
Aug 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.100-preview.7.21379.14
- name: Setup .NET 5.0
uses: actions/setup-dotnet@v1
with:
Expand All @@ -23,6 +27,9 @@ jobs:
dotnet-version: 3.1.404
- name: Setup NUKE
run: dotnet tool install Nuke.GlobalTool --global
- name: Install Workloads
# TODO: This is slow. Maybe we can make a docker container with this already done?
run: dotnet workload install android android-aot ios maccatalyst maui
Comment on lines +30 to +32
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not want to matrix this and have separate CI for core, new Android, old Android, new IOS and old IOS?

Copy link
Member Author

@Perksey Perksey Aug 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given we're multitargeting we need all of them in any case. We'd need to do lots of build hacking to get each buildable separately and it also would just massively complicate the workflow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it turns out it's not that slow, it only takes 2 minutes. The runners clearly have very good internet connection.

- name: Test
# skip Clean, Restore, and Compile as this will build the affect the whole solution.
# dotnet test will compile the necessary projects for testing only.
Expand All @@ -31,7 +38,7 @@ jobs:
run: nuke ValidateSolution
- name: Pack
# TODO build native mixins such as BuildLibSilkDroid
run: nuke Pack --configuration Release --msbuild-properties VersionSuffix=build${{ github.run_number }}.0 ContinuousIntegrationBuild=true --feature-sets Android iOS
run: nuke Pack --configuration Release --msbuild-properties VersionSuffix=build${{ github.run_number }}.0 ContinuousIntegrationBuild=true --feature-sets Legacy-Android Legacy-iOS
- name: Push to NuGet
if: ${{ github.repository == 'dotnet/Silk.NET' && github.event_name != 'pull_request' }}
run: nuke PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://pkgs.dev.azure.com/UltzOS/Silk.NET/_packaging/Experimental/nuget/v3/index.json --nuget-username ${{ secrets.AZDO_ARTIFACTS_USERNAME }} --nuget-password ${{ secrets.AZDO_ARTIFACTS_TOKEN }} --nuget-api-key az
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,27 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup .NET Core
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.100-preview.7.21379.14
- name: Setup .NET 5.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.201
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.404
- name: Setup NUKE
run: dotnet tool install Nuke.GlobalTool --global
- name: Install Workloads
# TODO: This is slow. Maybe we can make a docker container with this already done?
run: dotnet workload install android android-aot ios maccatalyst maui
- name: Setup NUKE
run: dotnet tool install Nuke.GlobalTool --global
- name: Pack
run: nuke Pack --msbuild-properties ContinuousIntegrationBuild=true SilkEnableSourceLink=true --feature-sets Android iOS
run: nuke Pack --msbuild-properties ContinuousIntegrationBuild=true SilkEnableSourceLink=true --feature-sets Legacy-Android Legacy-iOS
- name: Upload Unsigned Artifacts to Actions
uses: actions/upload-artifact@v2.2.4
with:
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,21 @@ In addition, the Silk.NET working group help drive larger user-facing changes pr

<h1 align="center">Building from source</h1>

- Make sure you have at least the .NET 5 SDK installed, preferably with Visual Studio's .NET Framework and Xamarin workloads too.
- Clone the repository
- Run build.sh, build.cmd, build.ps1, or `nuke build`. To build for iOS and Android, add the `--feature-sets ios android` arguments.
Prerequisites
- **Must**: .NET 6 SDK
- **Should**: Android (w/ AOT), iOS, and MAUI .NET 6 workloads (use `dotnet workload install android android-aot ios maui` to install them)
- **Should**: Android SDK version 30 with NDK tools installed
- **Could**: Java JDK (for gradle)
- **Could**: Visual Studio 2019 Community version 16.10 or later

Instructions
- Clone the repository (recursively)
- Run build.sh, build.cmd, build.ps1, or `nuke compile`. By default all packages targeting .NET Core, Standard, or .NET 6 are built. To build our older Xamarin iOS and Android packages, add the `--feature-sets legacy-ios legacy-android` arguments.
- Use the DLLs. To get nupkgs you can use with NuGet instead, use `nuke pack`.

There are more advanced build actions you can do too, such as FullBuild, Pack, FullPack, among others which you can view by doing `nuke --plan`.

Some projects may not build properly without being configured to use Desktop MSBuild (i.e. the MSBuild shipped with Visual Studio). As a result, you will ideally need to be on Windows and have Visual Studio 2019 Community (or greater) installed with .NET Core and Xamarin workloads. If you don't have this (i.e. because you're on Linux or Mac), you can still develop Silk.NET in a limited capacity but you will not be able to work on mobile workloads.
The older Xamarin projects will not build properly without being configured to use Desktop MSBuild (i.e. the MSBuild shipped with Visual Studio). As a result, you will ideally need to be on Windows and have Visual Studio 2019 Community (v16.10 or greater) installed with .NET Core and Xamarin workloads. If you don't have this (i.e. because you're on Linux or Mac), you won't be able to build the older Xamarin packages.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there actually a Rider configuration that allows to build one project with MSBuild v16 and another with v17? .NET 6 needs MSBuild v17

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rider can use desktop MSBuild if you configure it to. Why'd you ask?


<h1 align="center">Contributing</h1>

Expand Down
Loading