Skip to content

Conversation

@tomaszantas
Copy link
Contributor

Description

Add release-it package and release Github workflow to publish new version with Github actions.

Expected results:

  1. Only user with write permissions to the Github can trigger the workflow
  2. Workflow can be triggered on Github Actions page, where developer can select the type of update
  3. The release should:
  • bump the version in package.json
  • run build action
  • publish npm package
  • add new release on Github with the changelog

It should be also possible to run release locally after adding to package.json (not sure if we want to have it there...):

"scripts": {
  "release": "release-it"
}
$ npm run release
# ...or:
$ npm run release --ci patch

Troubleshooting

If it cannot access/publish NPM, it may require to add to the release.yml:

   - name: Release
        run: npm run release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} // <--- THIS

It may fail also on signing commits and tags. In such case, remove commitArgs and tagArgs from release-it.json.

In the future, when project is clean in terms of linters, we can add this:

  "hooks": {
      "before:init": ["npm run lint"], // <--- THIS
      "after:bump": ["npm run build"],
      "after:release": "echo Successfully created a release v${version}"
    }

Changes

  1. add release-it dep
  2. add release workflow

How this has been tested?

Not tested

@imkesin imkesin self-requested a review January 9, 2025 19:19
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