authgear / authgear-sdk-xamarin

Authgear authentication SDK for Xamarin applications
https://www.authgear.com/
Other
1 stars 9 forks source link

Investigate msbuild -t:pack that work cross platform #17

Closed roxk closed 2 years ago

roxk commented 2 years ago

dotnet msbuild doesn't work with "MSBuild.Sdk.Extras" (Yet?)

roxk commented 2 years ago

Seems we can ignore the error: https://github.com/novotnyllc/MSBuildSdkExtras/issues/161

roxk commented 2 years ago

Oh, seems like we can target dotnet 6 https://devblogs.microsoft.com/xamarin/tips-for-porting-your-xamarin-library-to-dotnet-maui/, which include the new build tools that allow multi-targeting by default. It also makes it compatible with MAUI by default :D

roxk commented 2 years ago

Updating tfm indeed allow dotnet pack to work as expected. However, as the resultant dll now targets net6.0, and net6.0-$platform, they are now not consumable by xamarin project (mostly .net5). One trick we can try is to modify the output folders so net6.0-android -> MonoAndroid12.0 before packaging, to see if the correct dll would be picked up by xamarin project, but that looks too hacky. Will try to see if we can simply ignore the error or has other workaround.

roxk commented 2 years ago

Decide to simply use github action to build for now. Goal:

  1. Minimal: manual publish based on tag/whatever git conditionals
  2. Consider adding nuget api token so CI can auto-publish as well. Again, must be tag/git-ref based
roxk commented 2 years ago

Nuget supports scoped API key: https://docs.microsoft.com/en-us/nuget/nuget-org/scoped-api-keys so it's safe to publish to nuget servers in CI.

roxk commented 2 years ago

https://github.com/actions/upload-artifact

Github action as expected support artifact uploading and retention/expiry :) Not sure if it has any additional fees by default though.

roxk commented 2 years ago

:tada: image