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

Automating github releases and release notes #3221

Closed
xt0rted opened this issue Feb 25, 2022 · 10 comments · Fixed by #3223
Closed

Automating github releases and release notes #3221

xt0rted opened this issue Feb 25, 2022 · 10 comments · Fixed by #3223

Comments

@xt0rted
Copy link
Contributor

xt0rted commented Feb 25, 2022

In #3215 (comment) it was mentioned that release notes were missing because it's done manually. I automated this with GitHub Actions and can PR a workflow for it if you'd like.

This one is triggered on release and updates it with the changelog contents so it doesn't have to be done manually. https://github.com/xt0rted/stylelint-actions-formatters/blob/main/.github/workflows/release.yml

If you're not creating the release and instead just pushing a tag then the workflow can be triggered by that and create the release for you. Either way if you'd like to automate this and want help just let me know.

@ljharb
Copy link
Member

ljharb commented Feb 25, 2022

That's an interesting offer. Unfortunately Github's own release note automation ignores PR-less commits, so it's not useful.

The only concern I have is that sometimes I'll push the tag, but then discover something that needs fixing first, so I'll force push the tag later - it's only on npm publish that the tag becomes conceptually immutable. Do you have an idea of how to work around that?

@xt0rted
Copy link
Contributor Author

xt0rted commented Feb 25, 2022

If you trigger off the tag then the workflow will run as soon as it's pushed. In this case it'd be best to manually create a release (maybe let that handle creating that tag too?) and have the workflow run from there.

This could still remove some manual steps though. The changelog is the right format to automatically be copied over, automatic release notes could be added, and publishing to npm could be done as well.

I force pushed a lot to my repo getting some of the recent versions published which is why I'm using the GitHub release as the trigger.

@xt0rted
Copy link
Contributor Author

xt0rted commented Feb 25, 2022

Looks like there's an endpoint to delete releases. It might be possible to check if a release already exists, delete it, and then create a new one for the tag. Then the rest of your workflow to publish it wouldn't need to change.

@ljharb
Copy link
Member

ljharb commented Feb 25, 2022

The problem is that I don't remember to create the release; pushing the tag is never something I forget.

I suppose as long as the following hold true:

  • a new tag creates a release
  • an overwritten tag deletes, and recreates, the release
  • a deleted tag deletes the release

that it should be fine. I'd love to review a PR :-)

@ljharb
Copy link
Member

ljharb commented Mar 11, 2022

This was done in #3223, thank you!

@ljharb ljharb closed this as completed Mar 11, 2022
@ljharb
Copy link
Member

ljharb commented Jun 23, 2022

@xt0rted it doesn't seem to be working quite right: https://github.com/jsx-eslint/eslint-plugin-react/releases/tag/v7.30.1

@xt0rted
Copy link
Contributor Author

xt0rted commented Aug 13, 2022

@ljharb The action that extracts the changelog details had a bug around the time of this release that caused the results to be empty, the version released in July fixed it. I just did a release using the same format you are and it correctly included all the links and contents of the version but there wasn't a blank line between the contents and link list so they didn't render correctly. I'll report that to the action's author.

@ljharb
Copy link
Member

ljharb commented Aug 13, 2022

Since that job is now 2 months old, and Actions won't let me simply rerun it, is there an easy way to rerun the action and properly populate the release content?

@xt0rted
Copy link
Contributor Author

xt0rted commented Sep 2, 2022

@ljharb a new release of the action went out this week that should fix the space issue. v7.31.2 doesn't have any formatting issues, so unless you manually adjusted it I think things are good going forward.

As for v7.30.1, it's probably easiest to manually update the release notes. I think this is everything you need for it:

## [7.30.1] - 2022.06.23

### Fixed
* [`display-name`]: fix false positive for HOF returning only nulls ([#3291][] @golopot)
* [`jsx-no-leaked-render`]: avoid unnecessary negation operators and ternary branches deletion ([#3299][] @Belco90)
* [`display-name`]: fix false positive when using memo ([#3304][] @golopot)

### Changed
* [Docs] [`jsx-tag-spacing`]: rename option from [#3264][] ([#3294[] @ljharb)
* [Docs] [`jsx-key`]: split the examples ([#3293][] @ioggstream)

[7.30.1]: https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.30.0...v7.30.1
[#3304]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3304
[#3299]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3299
[#3294]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3294
[#3293]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3293
[#3291]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3291

[#3294]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3294
[#3264]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3264

[`display-name`]: docs/rules/display-name.md
[`jsx-no-leaked-render`]: docs/rules/jsx-no-leaked-render.md
[`jsx-tag-spacing`]: docs/rules/jsx-tag-spacing.md
[`jsx-key`]: docs/rules/jsx-key.md

@ljharb
Copy link
Member

ljharb commented Sep 2, 2022

@xt0rted i did in fact have to manually adjust it - there's a bunch of undefineds printed out in multiple lines, and one of them is right above the footnote links so it breaks the rendering.

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

Successfully merging a pull request may close this issue.

2 participants