Skip to content

chore: Add release action #5

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

Merged
merged 11 commits into from
Nov 18, 2024
Merged

chore: Add release action #5

merged 11 commits into from
Nov 18, 2024

Conversation

ChristopherChudzicki
Copy link
Collaborator

@ChristopherChudzicki ChristopherChudzicki commented Nov 14, 2024

What are the relevant tickets?

For https://github.com/mitodl/hq/issues/6039

Description (What does it do?)

This PR adds semantic-release to release this package. It:

  • inspects commits since last release to construct changelog + decide next version number (major/minor/patch)
    • only commits using conventional commit are included
    • Since we usually squash commits, this repo is set to use PR title as default squashed commit message, and we enforce conventional commit PR titles.
  • publishes the release to NPM and github releases page

How can this be tested?

  1. Read the readme. It should make sense.
  2. View the "Release" section of https://github.com/mitodl/smoot-design/actions/runs/11846407719/job/33013978096 to see example changelog based on this branch + some empty test commits.
    • you can trigger this with github CLI via gh workflow run release --ref cc/releasing. Once this PR is merged, it can be manually triggered via action button.
  3. Change this PR title to something that is not a conventional commit; the PR check should fail with a somewhat useful message.
    • change it back, and the message should be deleted.

Checklist:

  • Write a README section
  • remove cc/releasing from .releaserc

@ChristopherChudzicki ChristopherChudzicki changed the title Cc/releasing chore: Add release action Nov 14, 2024
@ChristopherChudzicki ChristopherChudzicki changed the title chore: Add release action chzore: Add release action Nov 14, 2024
@ChristopherChudzicki ChristopherChudzicki changed the title chzore: Add release action chore: Add release action Nov 14, 2024
Copy link

@rhysyngsun rhysyngsun left a comment

Choose a reason for hiding this comment

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

One thing

env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
run: npx semantic-release --dry-run

Choose a reason for hiding this comment

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

Should this still have --dry-run?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. Removed that, and removed cc/releasing from the releaserc branches section.

Copy link

@rhysyngsun rhysyngsun left a comment

Choose a reason for hiding this comment

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

LGTM

@ChristopherChudzicki ChristopherChudzicki merged commit 09c2847 into main Nov 18, 2024
6 checks passed
@ChristopherChudzicki
Copy link
Collaborator Author

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants