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

Prerelease, release and changelog #203

Open
noreiller opened this issue Aug 4, 2017 · 8 comments
Open

Prerelease, release and changelog #203

noreiller opened this issue Aug 4, 2017 · 8 comments

Comments

@noreiller
Copy link
Contributor

noreiller commented Aug 4, 2017

Hi, I publish prereleases versions of my package and everything works fine, but once the release is ready, I would like to combine all the commits from the prereleases in the release changelog.
Is there a way to do this ?

I tried the { skip: { changelog: true} } config for prereleases, but it doesn't help since the commits are releated to tags.

Thank you,
Aurélien

@yoitsro
Copy link

yoitsro commented Aug 4, 2017

We're also having this issue. Ideally, it'd be great to be able to specify the type of version where we want the changelog to be generated from. I.e. generate the changelog from the last non prelease version.

@noreiller
Copy link
Contributor Author

@yoitsro It's not so simple. I hijacked the library to be able to send { from: "v1.2.3" } in gitRawCommitsOpts but it's not working. The changelog successfully parses all the commit from the requested version to the last, but since, the library groups them by tag, it's not the result I would like.

One of the solution could be to avoid prerelease changelogs, this way, only release changelogs would be written.
If the prerelease changelogs are mandatory, this could be another solution, but way more complex:

  • if the from tag is not the previous one
  • if prereleases tags are detected
  • if the last version is not a release
  • so the release could loop again on commits to list them in the release changelog.

@yoitsro
Copy link

yoitsro commented Aug 4, 2017

Hey @noreiller. So we're not actually generating the changelog on prereleases (in this case, our develop branch), but we do want the commit to be tagged with the prerelease version. This is because we want the package.json to be updated to reflect this version because it's the package.json version is read from within the app.

But then that means we need to actually push the tags (without any file changes) so that the next time our CI is run, it picks up on the last tag, changes the package.json version field, and then it can bump the version as per usual (with the prerelease version).

This is not ideal because on merges to master (where we do want the changelog generated, it can't see any differences between the last tag and the master branch because, technically, there are none.

Our desired behaviour would be for pushes to develop to do a prerelease bump (but not necessarily commit the file changes). Then, upon a push to master, to generate a changelog and version number from the commits which have been done since the last push to master. Any ideas?

@pmcalmeida
Copy link

I was able to go around this by skipping the tag and changelog on prerelease, so on the next release it will generate the changelog based on the last actual release.
yarn release --prerelease beta --skip.changelog=true --skip.tag=true

@brettswift
Copy link

This is really stale, however this is as far as I've taken it.

First off, I can't skip tags, as that is how my pre-release packages are triggered. I can probably fix this but I don't want to publish every feature branch and every commit. So tags are my event.

  1. prerelease with --skip.changelog
  2. push && ci publishes package.
  3. for a real release, I just delete that tag locally
    • not automated yet, but could be a pre-release to delete the tag
      • if the current version contains "beta"
      • get the tag name from (package.json:version)
      • git tag -d $ver

kinda meh.. not a fan of it, but maybe it'll help someone get around this.

ideally standard-version --pre-release --aggregate-pre-releases=true would be nice :)

@eckdanny
Copy link

eckdanny commented Jul 1, 2021

Realize today i never shared my workaround. So here it is:

We wanted:

type commit changelog tag  
release v1.2.3
prerelease 🚫 🚫 v1.2.3-rc.0

Desired: changelog generation relative to previous release, not last prerelease tag (e.g.; v1.2.3-rc.N)

So we just delete the non-release tags, run standard-version, and restore them

git tag -l | grep -vE '^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$' | xargs git tag -d
npx standard-version [...args]
git fetch origin --tags

I would prefer this to be a feature of standard-version tho.

@alvis
Copy link

alvis commented Oct 1, 2021

Ideally, change logs should be generated in related to its tag (ie changes among pre release tags & changes among release tags).

@bencat-sixense
Copy link

Is there any news about it ?

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

No branches or pull requests

8 participants