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

feat: added override to prerelease version numbers #3198

Closed
wants to merge 1 commit into from

Conversation

JTeeuwissen
Copy link

Fixes: #1793

Modified version of: #1894

The aim of this PR is to allow prerelease version overrides, without resorting to build tags. Which, although supported by SemVer, are not supported by NuGet (which removes the info, causing problems when uploading the same version with different build info).
Overriding this version allows e.g. the pipeline id to be used for increasing versions, even after force pushing to the prerelease branch.

@L3o-pold
Copy link

@JTeeuwissen can you show an example of prerelease-version value? I don't get it reading the doc and code.

@JTeeuwissen
Copy link
Author

JTeeuwissen commented Feb 19, 2024

@L3o-pold Sure, Azure Devops names their pipelines like so: #RepoName_CI_2024.02.19.1. Thus, we can use the following value:
${build.replace(/^.*_(\d*).(\d*).(\d*).(\d*)$/, '$1-$2-$3.$4')} to turn the prerelease version into something like this: 2024-02-19.1. With version it could look like: v1.2.3-beta.2024-02-19.1. Which works across force pushes and on NuGet while remaining ordered chronologically. And this allows me to find the pipeline responsible for a release easily.

@L3o-pold
Copy link

L3o-pold commented Feb 19, 2024

@JTeeuwissen from where commit and build are populated? ENV var?

@JTeeuwissen
Copy link
Author

JTeeuwissen commented Feb 19, 2024

@L3o-pold envCi is populated using the env-ci package, which is given the env and cwd. But that already was a part of the existing context.

@travi
Copy link
Member

travi commented Feb 19, 2024

closing based on #1793 (comment)

this could potentially be a better fit related to #3046 than related to the existing pre-release workflow. worth noting that we have not yet accepted that request as a type of workflow that we would be willing to support within semantic-release

@travi travi closed this Feb 19, 2024
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.

Improved handling of rebases on pre-release branches
3 participants