Skip to content

ci: use standard-version to generate new version from conventional commits #33

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

Closed
wants to merge 1 commit into from

Conversation

SKalt
Copy link
Contributor

@SKalt SKalt commented Apr 11, 2023

This PR adds a local workflow for creating a git tag for a release. Here's the proposed workflow: npm run prepare-release will run standard-version. standard-version bumps the versions in package.json and Cargo.toml and adds an autogenerated entry to CHANGELOG.md, then commits those changes and tags them with the new version. You can safely test this workflow locally.

This tooling augments the new github workflows for #30 : you can associate a new release with the generated tags, or you could trigger the package-publishing workflows

on:
  push:
    tags:
      - 'v*.*.*'

Cargo.lock Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This diff arose due to running cargo update, which I ran while experimenting with publishing a crate. While not strictly related to this PR, it's worth keeping.

@@ -1,7 +1,7 @@
[package]
name = "tree-sitter-gitcommit"
description = "gitcommit grammar for the tree-sitter parsing library"
version = "0.0.1"
version = "0.2.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to manually bump this version to match the version in package.json. scripts/update-cargo-version.js will handle version bumps.

@@ -0,0 +1,31 @@
/// @ts-check

const versionPattern = /[ \t]*version\s*=\s*"([^"]+)"/;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using a regex is faster and easier to understand than parsing and patching the entire abstract syntax tree of the Cargo.toml document.

@SKalt SKalt changed the title ci: draft package release process ci: use standard-version to generate new version from conventional commits Apr 12, 2023
@SKalt SKalt force-pushed the automate-npm-and-cargo-releases branch 2 times, most recently from d3e6b14 to a173d77 Compare April 12, 2023 13:39
This commit adds a local workflow for creating a git tag
for a release.  Here's the proposed workflow: `npm run
prepare-release` will run `standard-version`. `standard-version`
bumps the versions in `package.json` and `Cargo.toml` and
adds an autogenerated entry to `CHANGELOG.md`, then
commits those changes and tags them with the new version.
You can safely test this workflow locally.

This tooling augments the new github workflows for gbprod#30:
 you can associate a new release with the generated tags,
or you could trigger the package-publishing workflows

```yaml
on:
  push:
    tags:
      - 'v*.*.*'
```
@SKalt SKalt force-pushed the automate-npm-and-cargo-releases branch from a173d77 to 5ff5a6e Compare April 12, 2023 13:46
@gbprod
Copy link
Owner

gbprod commented Apr 13, 2023

Thanks for your PR!
I will take some times to review and think about it.
I try to do it ASAP !

@gbprod gbprod force-pushed the main branch 4 times, most recently from 9093562 to adf879c Compare April 18, 2023 07:42
@gbprod
Copy link
Owner

gbprod commented Apr 19, 2023

Hi @SKalt !
I've made my own workflow to publish to crates and npm that better suits my way of working.
You can find the published version here :

@gbprod gbprod closed this Apr 19, 2023
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