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

workflow: separate version bumping and publishing on release #6879

Merged
merged 9 commits into from
Feb 12, 2022

Conversation

antfu
Copy link
Member

@antfu antfu commented Feb 12, 2022

Workflow Changes

  • npm run release script moved to top-level with an interactive prompt to select the package
  • version bumping is done with npm run release instead of GH action dispatching
  • The flow of releasing becomes:
    1. Maintainer runs npm run release locally at project root of the latest main branch
    2. Select the package and version that need to be released
    3. The scripts handle version bumping, changelog, git commit with tag and push it to GH
    4. The commit tag triggers Actions to do the building and publishing on CI https://github.com/vitejs/vite/actions/workflows/publish.yml
    5. Done.

Changes Details

  • npm run release moved to root, and no longer runs building and publishing.
  • --skipBuild option has been removed. We use prepublishOnly hook to trigger the build before publishing.
  • changelog scripts in each package has been inlined in the release script to reduce duplication
  • Use npm publish instead of yarn publish since we already handle the version bumping.

New Features

  • npm run release will show commits between the last release of a package for the maintainer to reference

run: pnpm install

- name: Publish package
run: pnpm run ci-publish -- ${{ github.ref_name }} --dry
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: remove the --dry flag

scripts/releaseUtils.ts Outdated Show resolved Hide resolved
@patak-dev
Copy link
Member

The flow looks awesome Anthony, after seeing the three clicks (because of the environment approval) and waiting at each step for the GitHub UI to respond when using dispatch, it makes a lot more sense to use the CLI as you proposed.

@antfu
Copy link
Member Author

antfu commented Feb 12, 2022

Kapture.2022-02-12.at.18.39.48.mp4

Added a little helper to show the git diff since the last release

scripts/releaseUtils.ts Outdated Show resolved Hide resolved
Co-authored-by: patak <matias.capeletto@gmail.com>
@patak-dev patak-dev merged commit fe8ef39 into main Feb 12, 2022
@patak-dev patak-dev deleted the release-cli branch February 12, 2022 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants