Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Create a CHANGELOG.md before publishing extension update#810

Merged
vinistock merged 2 commits intoShopify:mainfrom
snutij:create-changelog-for-extensions-on-publish
Oct 2, 2023
Merged

Create a CHANGELOG.md before publishing extension update#810
vinistock merged 2 commits intoShopify:mainfrom
snutij:create-changelog-for-extensions-on-publish

Conversation

@snutij
Copy link
Copy Markdown
Contributor

@snutij snutij commented Sep 28, 2023

Motivation

Closes Shopify/ruby-lsp#1645

The need is to create a CHANGELOG.md (without manual intervention) packaged into the extension publish.

Implementation

  • Retrieve all releases (including last one as this workflow is trigger after the release)
  • Keep tag version and body (content of the release note)
  • Prepend a # before the tag to make a clear separation in the markdown between each release
  • Insert this into a CHANGELOG.md at the root level as required by the specification

Automated Tests

Impossible as I can't publish it myself.

Manual Tests

I did a test, adding this code in the ci.yml workflow to check that everything goes as expected on push on my fork.
Result is available here: https://github.com/snutij/vscode-ruby-lsp/actions/runs/6344046810/job/17233282072

  • ls output show the root level with the CHANGELOG.md
  • cat CHANGELOG.md show the output well formatted

Note: we can see before each release note content this <!-- Release notes generated using configuration in .github/release.yml at main --> but we don't care as this is a comment it should not be displayed into vscode extension changelog tab.

I'll not copy-past output here, because it will link this PR to all PR already merged 😄

@snutij snutij requested a review from a team as a code owner September 28, 2023 21:05
@snutij snutij requested review from Morriar and st0012 September 28, 2023 21:05
Comment thread .github/workflows/publish.yml Outdated

- name: Create CHANGELOG.md
run: |
RELEASE_NOTES=$(curl -L https://api.github.com/repos/Shopify/vscode-ruby-lsp/releases)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using curl, let's use github-script.

We can fetch only the latest release directly and I'm sure the release's ID or tag must be present in the action's context object. That way we don't need to use curl or jq.

Copy link
Copy Markdown
Contributor Author

@snutij snutij Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can but doing that CHANGELOG will include only lastest release information. Is it the expected behavior?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. It probably makes more sense to include everything. Let's still use github-script if possible though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snutij snutij force-pushed the create-changelog-for-extensions-on-publish branch from 062a375 to ea94ec5 Compare September 30, 2023 16:18
Copy link
Copy Markdown
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Thank you for putting this together and testing it!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Changelog to the extension in the VSCode Marketplace

2 participants