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

Migrate to 🦋 changesets #1314

Merged
merged 10 commits into from
Sep 9, 2023
Merged

Migrate to 🦋 changesets #1314

merged 10 commits into from
Sep 9, 2023

Conversation

iiroj
Copy link
Member

@iiroj iiroj commented Aug 15, 2023

This PR is for random cleanup targeted at preparing to switch to 🦋 changesets, by:

  • add lint-staged version, node version and platform to debug logs
  • install commitlint for linting commit messages according to the conventional commits specification
    • for pull requests, validate all commit messages in CI
  • adjusting the current semantic-release job to use conventionalcommits instead of default angular
  • limit the security analysis CI jobs to run only on master (or PR targeting master)
  • extract the npm ci CI step into its own separate job with caching

...and finally:

  • replace semantic-release with changesets

@iiroj iiroj force-pushed the commitlint branch 2 times, most recently from a1cdd80 to 033292d Compare August 15, 2023 07:03
@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Patch has no changes to coverable lines.

📢 Thoughts on this report? Let us know!.

@iiroj iiroj changed the title Commitlint Migrate to 🦋 changesets Aug 15, 2023
@iiroj iiroj force-pushed the commitlint branch 3 times, most recently from ba082f0 to b666e8b Compare August 15, 2023 07:53
@iiroj
Copy link
Member Author

iiroj commented Aug 15, 2023

Ping @okonet you might want to install the Changesets bot to this repo: https://github.com/apps/changeset-bot

.github/workflows/main.yml Outdated Show resolved Hide resolved
@iiroj iiroj requested a review from okonet August 15, 2023 12:32
.releaserc.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@iiroj
Copy link
Member Author

iiroj commented Aug 17, 2023

I'll copy a similar implementation to one of my own repos to make sure it works as expected.

@iiroj
Copy link
Member Author

iiroj commented Aug 18, 2023

Had to tweak it more than expected, but got it working here: https://github.com/iiroj/iiro.fi

I mostly had to tweak the version commands to get the package-lock.json file updated, and to only create a single commit. The trick was to commit manually:

https://github.com/iiroj/iiro.fi/blob/0b69b1010e3119183dfc7ad4d23e27037dc450c6/package.json#L17-L18

    "version": "npx changeset version",
    "postversion": "npm i --package-lock-only && git commit -am \"chore(changeset): release\"",

and run npm run version in the CI.

@iiroj
Copy link
Member Author

iiroj commented Aug 18, 2023

I generated the CHANGELOG.md file because going forward it will be committed to the repo during 🦋 changeset versioning. I used this tool and tweaked manually: https://github.com/rhysd/changelog-from-release

@iiroj
Copy link
Member Author

iiroj commented Sep 9, 2023

Ping @okonet it would be nice to test dropping Node.js 16 support using changesets. It goes EOL in two days, on September 11th 2023: https://nodejs.dev/en/about/releases/

@okonet
Copy link
Collaborator

okonet commented Sep 9, 2023

Sure let’s give it a go. What’s required from my end? Approval or do I need to test it somehow?

@iiroj
Copy link
Member Author

iiroj commented Sep 9, 2023

I tested and synced this config with the https://github.com/iiroj/iiro.fi repo, so after this PR is merged, versioning should happen via 🦋 changesets. Since this PR has an empty changeset file, no automatic version PR should be opened.

After I create a new PR for the Node.js 16 deprecation with a changeset file, we should see some new functionality.

So, should I just merge this?

@iiroj iiroj merged commit a39b79b into master Sep 9, 2023
19 checks passed
@iiroj iiroj deleted the commitlint branch September 9, 2023 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants