-
Notifications
You must be signed in to change notification settings - Fork 264
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
chore: add release workflow #805
Conversation
name: Ship js Schedule Prepare | ||
on: | ||
schedule: | ||
- cron: '0 9 * * 2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can change the cron expression if there's any preferred time/date.
Currently it's every Tuesday 02:00 UTC.
publishCommand: ({ defaultCommand, tag }) => | ||
`${defaultCommand} --access public --tag ${tag}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will run a command like npm publish --access public --tag latest
.
shouldPrepare: ({ releaseType, commitNumbersPerType }) => { | ||
const { fix = 0 } = commitNumbersPerType | ||
if (releaseType === 'patch' && fix === 0) { | ||
return false | ||
} | ||
return true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's going to be a patch release, but doesn't include "fix" commits, then it will skip the release. Think about having only "chore" commits. You probably don't want to release it.
This is especially useful when you have scheduled releases.
Hi @eunjae-lee, sorry about the delay on this - I will go over it this week! |
Hello @lmiller1990, how are you doing? |
Relevant: github/roadmap#248 we might want to wait until GitHub ships its own release management tool :) |
Automated releases are certainly a good idea, I was thinking we may want to get 2.0.0 out before we merge this. Thanks for the work @eunjae-lee, sorry I left this hanging for so long. |
No worries @lmiller1990 :) |
We finally moved to 2.0.0. I'll take a look at this soon, so we can have automatic releases. |
If we do end up automating this, I think we should go with semantic release to be in line with other Vue projects. I'm going to close this one for now, but I appreciate the effort. |
Summary
This PR adds the release workflow using Ship.js.
fixes #801
Release Workflow
Prepare: It will prepare a release pull-request which includes version bumping and changelog updates.
Review: Maintainers review the PR, probably updates some changelogs, approve and merge it.
Trigger: CI (in this case, GitHub Actions) is triggered, and it builds, and releases the package to NPM. It also creates a git tag and GitHub releases.
More about "Prepare" step
There are three ways to prepare release pull-request.
.github/workflows/shipjs-schedule-prepare.yml
, it will automatically prepare the pull-request every week.yarn run prepare
locally with the environment variable GITHUB_TOKEN..github/workflows/shipjs-manual-prepare.yml
, if maintainers of this repo adds a comment@shipjs prepare
to any comment, it will prepare a release pull-request. (← If you don't want this behavior, you can remove the workflow file.)Remaining Setup
This repo needs to have two environment variables for GitHub Actions:
GITHUB_TOKEN
: https://github.com/settings/tokens/newNPM_AUTH_TOKEN
: If your NPM account has 2FA enabled, you need to create "Automation" token.