nblockchain / fsx

FSX is the ideal tool for people that use F# for their scripting needs.
MIT License
14 stars 5 forks source link

Add CI steps and fsxc settings to pack and publish the package on NuGet website #8

Closed tehraninasab closed 1 year ago

knocte commented 1 year ago

CI in your branch is red, please fix.

Also can you add me as co-owner of package https://www.nuget.org/packages/fsx and https://www.nuget.org/packages/fsxc please (my username in nuget is same as in github).

tehraninasab commented 1 year ago

CI in your branch is red, please fix.

Also can you add me as co-owner of package https://www.nuget.org/packages/fsx and https://www.nuget.org/packages/fsxc please (my username in nuget is same as in github).

Done

knocte commented 1 year ago

Ok good! Now it's when we're going to talk properly about versioning, a change that will be the last to get this PR ready to merge.

There are three things that this PR doesn't fulfil at the moment: a) Ideally, every push to the repository should generate a new version of the package in nuget, but it should only generate pre-releases this way. However, when a git tag is pushed, it's when a non-prerelease version should be uploaded. b) The pre-releases having versions that reflect the date is great idea, but you know what is even greater? reflect the git hash of the last commit in the version too. c) The repo already had some version info in it, look at the file "version.config": https://github.com/nblockchain/fsx/blob/master/version.config

To achieve the above, you're going to, instead of generating a version.txt file from CI, you're going to use the script Tools/nugetPush.fsx (https://github.com/nblockchain/fsx/blob/master/Tools/nugetPush.fsx) using the following arguments: --output-version 0.6. The 0.6 will come from the version.config file (which you'll modify to be BaseVersion=0.6 instead of Version=0.6.0.0. That, of course, if the push is a normal push, but if the push is a tag, then you're going to use the same exact version of the tag (e.g. if tag is 0.6.0.1, then just use that version; no need to call nugetPush.fsx for this). Checking if the commit pushed is a tag or not can be done with an if element in the dotnet pack CI step.

tehraninasab commented 1 year ago

This PR is closed and replaced by https://github.com/nblockchain/fsx/pull/9 because some commits needed to be squashed.

tehraninasab commented 1 year ago

Ok good! Now it's when we're going to talk properly about versioning, a change that will be the last to get this PR ready to merge.

There are three things that this PR doesn't fulfil at the moment: a) Ideally, every push to the repository should generate a new version of the package in nuget, but it should only generate pre-releases this way. However, when a git tag is pushed, it's when a non-prerelease version should be uploaded. b) The pre-releases having versions that reflect the date is great idea, but you know what is even greater? reflect the git hash of the last commit in the version too. c) The repo already had some version info in it, look at the file "version.config": https://github.com/nblockchain/fsx/blob/master/version.config

To achieve the above, you're going to, instead of generating a version.txt file from CI, you're going to use the script Tools/nugetPush.fsx (https://github.com/nblockchain/fsx/blob/master/Tools/nugetPush.fsx) using the following arguments: --output-version 0.6. The 0.6 will come from the version.config file (which you'll modify to be BaseVersion=0.6 instead of Version=0.6.0.0. That, of course, if the push is a normal push, but if the push is a tag, then you're going to use the same exact version of the tag (e.g. if tag is 0.6.0.1, then just use that version; no need to call nugetPush.fsx for this). Checking if the commit pushed is a tag or not can be done with an if element in the dotnet pack CI step.

Done

knocte commented 1 year ago

This PR is closed and replaced by https://github.com/nblockchain/fsx/pull/9 because some commits needed to be squashed.

Whenever you close a PR again because there's a new one with the same work, please don't forget to also mention the old PR in the new PR. For example, in the new PR's description, use the text "Supersedes PR #8".

tehraninasab commented 1 year ago

This PR is closed and replaced by #9 because some commits needed to be squashed.

Whenever you close a PR again because there's a new one with the same work, please don't forget to also mention the old PR in the new PR. For example, in the new PR's description, use the text "Supersedes PR #8".

Ok