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

GitHub Actions: upload nupkg as artifact #175

Merged
merged 3 commits into from
Feb 28, 2024
Merged

Conversation

janusw
Copy link
Member

@janusw janusw commented Feb 27, 2024

Note: I'm using git describe --tags to generate a unique version number for each package that is built. This scheme will also generate a proper version for a release, if the corresponding tag is set.

* for this to work, we need to set "fetch-depth",
  in order to check out all tags
@janusw
Copy link
Member Author

janusw commented Feb 28, 2024

The nupkg generated for this PR is here: https://github.com/GeoJSON-Net/GeoJSON.Net/actions/runs/8071855382#artifacts

It obtained the version 1.2.15-28-g01bab48, since 1.2.15 seems to be the last tag present in the repository (and there were 28 commits since then). Tags for all later versions seem to be missing.

@xfischer
Copy link
Member

xfischer commented Feb 28, 2024

Hi @janusw and thanks for that. So if I understand well, this is a first step towards prelease package automation, and automatic nuget publish ? Did I miss something ?

EDIT : found the related discussion here : #167 (comment)

@xfischer xfischer merged commit 16cb756 into GeoJSON-Net:master Feb 28, 2024
2 checks passed
@janusw janusw deleted the gha_pkg branch February 28, 2024 10:21
@janusw
Copy link
Member Author

janusw commented Feb 28, 2024

Hi @janusw and thanks for that. So if I understand well, this is a first step towards prelease package automation, and automatic nuget publish ? Did I miss something ?

Yes, basically. This is the way I handle packaging for some other libraries as well. Having a package built for every PR makes it much easier for users to test pre-release versions.

As written on the other thread, automatic publishing on nuget.org is certainly possible as well, but I'm not so sure if it's worth to go there. Once everything is automatically packaged and versioned, the final upload for publishing is really quick and simple.

For building a "release" package, once can simply set a tag for the release version (like "2.0.0"), and push it together with the final commit (or re-trigger the CI after pushing the tag). Then GHA will use the correct version 2.0.0 for the package, and it can be directly uploaded to nuget.org.

@janusw
Copy link
Member Author

janusw commented Feb 28, 2024

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants