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

Automatically increment version in package.json on new release 📦 #557

Open
2 tasks
JamieSlome opened this issue May 10, 2024 · 7 comments
Open
2 tasks
Assignees
Labels
dependencies Pull requests that update a dependency file good first issue Good for newcomers

Comments

@JamieSlome
Copy link
Member

JamieSlome commented May 10, 2024

Due to the fabulous @eddie-knight, GitProxy now has auto releases 💪 As part of #532, generally, all pull requests merged into main will result in a new release to GitHub Releases and NPM.

To ensure consistency across the codebase, GitHub Releases and NPM versions, we should ensure that the root package.json reflects the latest auto release version.

Tasks

@JamieSlome JamieSlome added good first issue Good for newcomers dependencies Pull requests that update a dependency file labels May 10, 2024
@JamieSlome
Copy link
Member Author

@eddie-knight - interested in taking this one and polishing off your Mona Lisa of contributions?

@eddie-knight
Copy link
Contributor

@JamieSlome spitballing here... what about adding something like this?

      - run: npm ci
      - name: Update package.json version
        id: update_version
        run: |
          version="${{ steps.release-drafter.outputs.tag_name }}"
          jq --arg version "$version" '.version = $version' package.json > package_tmp.json
          mv package_tmp.json package.json

Note that the version number in the git repo will no longer be managed.

The only alternative I can think of would be to shift to another action like semantic-release. It seems to automatically bump the npm version number, but also doesn't update it in the git repo.

@JamieSlome
Copy link
Member Author

JamieSlome commented May 16, 2024

Hmm, it seems that the guidance you've attached from semantic-release doesn't recommend updating the version in the repository as it can complicate the pipeline even more.

Semantic release themselves don't even update the version property in their package.json 🤔 Perhaps we just leave it and ignore the version number moving forward?

@eddie-knight
Copy link
Contributor

Semantic release themselves don't even update the version property in their package.json 🤔 Perhaps we just leave it and ignore the version number moving forward?

I think we still need something to update the version number before publishing to npm, right?

@JamieSlome
Copy link
Member Author

@eddie-knight - yes, we should make sure that the package.json value is actually updated in the release, and just permanently set our version to 0.0.0-development as instructed in the documentation site attached. I wonder if release-drafter already does this? If not, we should probably pivot to semantic-release and take advantage of the package.json bump for both GitHub Release and NPM. Means we can continue to use the commit titles as a standard for defining our release and bump type.

@JamieSlome
Copy link
Member Author

JamieSlome commented May 21, 2024

@tt-gideonaryeetey and @divinetettey - asked discussed, are you interested in picking this issue up? Let me know below and then I can assign to you if you're happy to 👍

@divinetettey
Copy link

Hi @JamieSlome yes I would be picking up this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants