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

Build nuget packages in CI and push to nuget.org #99

Merged
merged 6 commits into from
Jan 8, 2025

Conversation

webwarrior-ws
Copy link

@webwarrior-ws webwarrior-ws commented Nov 28, 2024

Description of Change

Build nuget packages for commits in "main" branch or tags
and upload to nuget.org.

For main branch, create pre-release packages, and for tags
create stable release packages.

One thing left to do is to rename packages so they don't collide with Microsoft's MAUI packages. Maybe change Microsoft.Maui prefix to something like MauiLinux?

Issues Fixed

Fixes #94

Because currently used version 8.0.0 has vulnerability, which
produces the following error during build:

```
error NU1903: Warning As Error: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, GHSA-hh2w-p6rv-4g7w
```
Build nuget packages for projects in Microsoft.Maui.Gtk.slnf.
Use GITHUB_REF_NAME env. var to extract Git tag. If tag is not
the same as version extracted from GitInfo.txt, abort build
and show error.
@knocte
Copy link

knocte commented Dec 2, 2024

One thing left to do is to rename packages so they don't collide with Microsoft's MAUI packages. Maybe change Microsoft.Maui prefix to something like MauiLinux?

Do you agree with this prefix @jsuarezruiz ?

@webwarrior-ws webwarrior-ws force-pushed the fix-linux-maui-94 branch 6 times, most recently from 98975ef to 733e516 Compare December 3, 2024 12:21
@lytico
Copy link
Collaborator

lytico commented Dec 3, 2024

about naming we had an issue already: #6
so in this "tradition" it could be named as: Gtk.Maui or GtkSharp.Maui

@knocte
Copy link

knocte commented Dec 4, 2024

@lytico so, replace "Microsoft.Maui." prefix with "GtkSharp.Maui." ?

@lytico
Copy link
Collaborator

lytico commented Dec 4, 2024

replace "Microsoft.Maui." prefix with "GtkSharp.Maui." ?

yes, would be my suggestion

@jsuarezruiz
Copy link
Owner

One thing left to do is to rename packages so they don't collide with Microsoft's MAUI packages. Maybe change Microsoft.Maui prefix to something like MauiLinux?

Do you agree with this prefix @jsuarezruiz ?

Agree, cannot use Microsoft.Maui prefix for now, something like:
Community.Maui.Linux.
GtkSharp.Maui.

Or similar. @webwarrior-ws Could you rename packages?

@webwarrior-ws webwarrior-ws force-pushed the fix-linux-maui-94 branch 3 times, most recently from 7b985f7 to 230f2df Compare December 4, 2024 10:50
@webwarrior-ws
Copy link
Author

@jsuarezruiz renamed packages to have GtkSharp.Maui. prefix

@knocte
Copy link

knocte commented Dec 4, 2024

@webwarrior-ws I guess the next step is to give permissions to upload in nuget.org to Javier so that he can use his nuget key inside a NUGET_KEY secret var of the repo.

@webwarrior-ws
Copy link
Author

@webwarrior-ws I guess the next step is to give permissions to upload in nuget.org to Javier so that he can use his nuget key inside a NUGET_KEY secret var of the repo.

What permissions? Packages that I uploaded to nuget using my nuget key have Mali. prefix. Packages in this PR haven't been uploaded to nuget.org.

@knocte
Copy link

knocte commented Dec 4, 2024

Packages in this PR haven't been uploaded to nuget.org.

So, do you need to upload them first so that when merging this PR they get published?

@webwarrior-ws
Copy link
Author

Packages in this PR haven't been uploaded to nuget.org.

So, do you need to upload them first so that when merging this PR they get published?

There is no need for it. If appropriate NUGET_KEY secret is present, packages will be uploaded using dotnet nuget push command.

Upload pre-release package on `main` branch using
nugetPreRelease.fsx to get a version number that
includes the date and commit hash inside it.
Add a solution filter with projects that should be made into
packages.
Rename Microsoft.Maui.* packages to GtkSharp.Maui.* so they
can be published on nuget.org. Add notice about it being fork
of MAUI in package descriptions.
@knocte
Copy link

knocte commented Dec 4, 2024

There is no need for it. If appropriate NUGET_KEY secret is present, packages will be uploaded using dotnet nuget push command.

Are you sure you can push the first version of a package with dotnet nuget push? I mean, nuget API keys need to be applied to certain packages, so you need the package to exist first before being able to create an API key that can update versoins of it, if I'm not missing something.

@webwarrior-ws
Copy link
Author

There is no need for it. If appropriate NUGET_KEY secret is present, packages will be uploaded using dotnet nuget push command.

Are you sure you can push the first version of a package with dotnet nuget push? I mean, nuget API keys need to be applied to certain packages, so you need the package to exist first before being able to create an API key that can update versoins of it, if I'm not missing something.

Yes, that's how I published packages I've been working on. But that depends on nuget API key having permission to create new packages.

@knocte
Copy link

knocte commented Dec 4, 2024

Ok cool, then @jsuarezruiz you need to set a NUGET_KEY to this repo first before merging this.

@jsuarezruiz
Copy link
Owner

NUGET_KEY

Ok, already created the NUGET_KEY repository secret with an API key.

@lytico lytico marked this pull request as ready for review December 9, 2024 14:59
@jsuarezruiz jsuarezruiz requested a review from Copilot December 10, 2024 11:05
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 21 out of 35 changed files in this pull request and generated 1 suggestion.

Files not reviewed (14)
  • Microsoft.Maui.Gtk.Packages.slnf: Language not supported
  • eng/Versions.props: Language not supported
  • eng/Versions.targets: Language not supported
  • nugetPreRelease.fsx: Language not supported
  • src/BlazorWebView/samples/BlazorGtkApp/BlazorGtkApp.csproj: Language not supported
  • src/BlazorWebView/src/Gtk/Microsoft.AspNetCore.Components.WebView.Gtk.csproj: Language not supported
  • src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj: Language not supported
  • src/Compatibility/Core/src/Compatibility.csproj: Language not supported
  • src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj: Language not supported
  • src/Controls/src/Build.Tasks/Controls.Build.Tasks.csproj: Language not supported
  • src/Controls/src/Core/Controls.Core.csproj: Language not supported
  • src/Controls/src/Xaml/Controls.Xaml.csproj: Language not supported
  • src/Core/src/Core.csproj: Language not supported
  • src/Core/src/nuget/buildTransitive/GtkSharp.Maui.Core.After.targets: Language not supported

@jsuarezruiz jsuarezruiz self-requested a review December 10, 2024 11:05
@jsuarezruiz jsuarezruiz merged commit 70a5768 into jsuarezruiz:main Jan 8, 2025
7 of 8 checks passed
@Lemon73-Computing
Copy link

@github-actions github-actions bot locked and limited conversation to collaborators Feb 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nuget packages: prerelease for each commit and non-prerelease for each git tag? via GitHub Actions
5 participants