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

Automate release process #18

Open
paulRbr opened this issue May 10, 2021 · 1 comment
Open

Automate release process #18

paulRbr opened this issue May 10, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@paulRbr
Copy link
Member

paulRbr commented May 10, 2021

For now, if you wish to publish a new release of the CLI you need to:

  1. git checkout main
  2. npm run release for a full release (or npm run release -- --tag beta for a prerelease where --tag is the dist tag of your choice)
  3. The script above will prompt for the version upgrade you desire (patch, minor or major)
  4. Then it will do all this for you:
  • Check your in the right place
  • Check the version your trying to publish doesn't exist yet
  • Re-install npm dependencies from scratch
  • Run tests
  • Bump version with npm version ...
  • Publish package on npm
  • Push a git tag v<version>
  1. Wait for the CI to run on the pushed git tag (the CI will create a draft github release with standalone tarballs attached to it)
  2. Edit the newly created draft release to write release notes 📝 and publish the github release 🚀

Package distribution

With the above process we will only distribute a NPM package + standalone tarballs on the Github Release. For the future we will need to distribute packages in common package managers (Homebrew, .deb, .rpm & .aur, Docker, Nix, Snap ...?)

@paulRbr paulRbr added the enhancement New feature or request label May 10, 2021
paulRbr referenced this issue in paulRbr/cli May 25, 2021
As part of #18 this is a test to try to push tarballs generated by
oclif to a Github Release.

The idea would for the release process to be the following:

- locally on a developer machine, bump the version, commit and tag:

  ```
  npm run publish -- --no-publish --no-release-draft 2.0.1
  ```

- once the tag is pushed, the CI kicks in by doing the following:
  - `npm publish` to publish package on NPM (TODO this needs to be tested)
  - Github release creation with upload of tarballs with this
    [github action](https://github.com/softprops/action-gh-release)
paulRbr referenced this issue in paulRbr/cli May 25, 2021
As part of #18 this is a test to try to push tarballs generated by
oclif to a Github Release.

The idea would for the release process to be the following:

- locally on a developer machine, bump the version, commit and tag:

  ```
  npm run publish -- --no-publish --no-release-draft 2.0.1
  ```

- once the tag is pushed, the CI kicks in by doing the following:
  - `npm publish` to publish package on NPM (TODO this needs to be tested)
  - Github release creation with upload of tarballs with this
    [github action](https://github.com/softprops/action-gh-release)
paulRbr referenced this issue in paulRbr/cli May 25, 2021
As part of #18 this is a test to try to push tarballs generated by
oclif to a Github Release.

The idea would for the release process to be the following:

- locally on a developer machine, bump the version, commit, tag and
  publish to npm:

  ```
  npm run publish -- --no-release-draft 2.0.1
  ```

- once the tag is pushed, the CI kicks in by doing the following:
  - Github release creation with upload of tarballs with this
    [github action](https://github.com/softprops/action-gh-release)
paulRbr referenced this issue in paulRbr/cli May 26, 2021
As part of #18 this is a test to try to push tarballs generated by
oclif to a Github Release.

The idea would for the release process to be the following:

- locally on a developer machine, bump the version, commit, tag and
  publish to npm:

  ```
  npm run publish -- --no-release-draft 2.0.1
  ```

- once the tag is pushed, the CI kicks in by doing the following:
  - Github release creation with upload of tarballs with this
    [github action](https://github.com/softprops/action-gh-release)
paulRbr referenced this issue in paulRbr/cli May 26, 2021
As part of #18 this is a test to try to push tarballs generated by
oclif to a Github Release.

The idea would for the release process to be the following:

- locally on a developer machine, bump the version, commit, tag and
  publish to npm:

  ```
  npm run publish -- --no-release-draft 2.0.1
  ```

- once the tag is pushed, the CI kicks in by doing the following:
  - Github release creation with upload of tarballs with this
    [github action](https://github.com/softprops/action-gh-release)
paulRbr referenced this issue in paulRbr/cli May 26, 2021
As part of #18 this is a test to try to push tarballs generated by
oclif to a Github Release.

The idea would for the release process to be the following:

- locally on a developer machine, bump the version, commit, tag and
  publish to npm:

  ```
  npm run publish -- --no-release-draft 2.0.1
  ```

- once the tag is pushed, the CI kicks in by doing the following:
  - Github release creation with upload of tarballs with this
    [github action](https://github.com/softprops/action-gh-release)
paulRbr referenced this issue in paulRbr/cli May 26, 2021
As part of #18 this is a test to try to push tarballs generated by
oclif to a Github Release.

The idea would for the release process to be the following:

- locally on a developer machine, bump the version, commit, tag and
  publish to npm:

  ```
  npm run publish -- --no-release-draft 2.0.1
  ```

- once the tag is pushed, the CI kicks in by doing the following:
  - Github release creation with upload of tarballs with this
    [github action](https://github.com/softprops/action-gh-release)
paulRbr referenced this issue in paulRbr/cli May 26, 2021
As part of #18 this is a test to try to push tarballs generated by
oclif to a Github Release.

The idea for the release process would be in two steps:

- locally on a developer machine: bump the version, commit, tag and
  publish to npm with the following command:

  ```
  npm run publish -- 2.0.1
  ```

  This will not create a github release anymore (due to the added
  `--no-release-draft` tag passed to `np`).

- once the tag is pushed, the CI kicks in with this [github action](https://github.com/softprops/action-gh-release)
  by doing the following:
  - Github draft release creation
  - Upload of standalone tarballs (generated by oclif)

- The developer can then edit the newly created draft release to
  write release notes and publish the release 🚀
paulRbr referenced this issue in paulRbr/cli May 26, 2021
As part of #18 this is a test to try to push tarballs generated by
oclif to a Github Release.

The idea for the release process would be in two steps:

- locally on a developer machine: bump the version, commit, tag and
  publish to npm with the following command:

  ```
  npm run publish -- 2.0.1
  ```

  This will not create a github release anymore (due to the added
  `--no-release-draft` tag passed to `np`).

- once the tag is pushed, the CI kicks in with this [github action](https://github.com/softprops/action-gh-release)
  by doing the following:
  - Github draft release creation
  - Upload of standalone tarballs (generated by oclif)

- The developer can then edit the newly created draft release to
  write release notes and publish the release 🚀
paulRbr referenced this issue in paulRbr/cli May 26, 2021
As part of #18 this is a test to try to push tarballs generated by
oclif to a Github Release.

The idea for the release process would be in two steps:

- locally on a developer machine: bump the version, commit, tag and
  publish to npm with the following command:

  ```
  npm run publish -- 2.0.1
  ```

  This will not create a github release anymore (due to the added
  `--no-release-draft` tag passed to `np`).

- once the tag is pushed, the CI kicks in with this [github action](https://github.com/softprops/action-gh-release)
  by doing the following:
  - Github draft release creation
  - Upload of standalone tarballs (generated by oclif)

- The developer can then edit the newly created draft release to
  write release notes and publish the release 🚀
paulRbr added a commit that referenced this issue Jun 13, 2023
As detailed in the NP (library that helps for the releases) readme,
the custom script name shouldn't be `publish` (because it's an
internal `npm` defined script). cf
https://github.com/sindresorhus/np#release-script

I always had the publishing script that got stuck right before pushing
the git tag and never understood why. Now that it's fixed I get it...

If only I had searched for this before 😅. Anyway no more manual git
push tag for the next releases, just use `npm run release` ☺️🎉.

I've updated the #18 issue which describes the release process.
@philsturgeon
Copy link

I've had a lot of success with semantic-release, automatically creating major, minor, or patch releases based on the commits that come in. I'd be happy to take a swing at setting that up if you like.

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

No branches or pull requests

2 participants