[ANN] PkgBump.jl: Automatically increment Julia Project file version

PkgBump.jl

Currently this project is WIP.

Introduction

When it comes to release new version of your package, you are supposed to update version entry Project.toml.

name = "YourJuliaPkg"
version = "0.1.0" # <---
...
...

I’m not sure how package developer update this file, but it would be nice to update, commit and push changes automatically.

PkgBump.jl

To do this, PkgBump.jl is created. You can install PkgBump.jl by executing the following commands:

$ git clone https://github.com/AtelierArith/PkgBump.jl
$ ls
PkgBump.jl
$ julia -e 'using Pkg; Pkg.activate(); Pkg.develop(path="PkgBump.jl")'

Currently, PkgBump.jl exports three functions named bumppatch, bumpminor and bumpmajor.
If you want to update version from 0.1.0 to 0.1.1, use bumppatch:

$ cd path/to/YourJuliaPkg.jl
$ julia --project -q
julia> using PkgBump
julia> pkgbump(; commit=false, push=false)

You’ll see your Project.toml or JuliaProject.toml is updated.

Note that, by default, keyword arguments are set to commit=true and push=true, which means you can commit and push changes to remote repository on the branch in the form of pkgbump/bump-to-version-$(new_version).

Now we only have to create a PR on GitHub or MR on GitLab and merge the branch into the default branch. Finally, call @juliaregister to register your new version of package in General registry.

Do you like PkgBump.jl?

2 Likes

Neat! Is this meant to be used in something like a Github Action for automation?

I like it, but unless it is hooked up to some CI automation, I probably would just edit/commit/push my Project.toml file directly (seems easier and faster).

1 Like

It seems easier to do

Pkg.add("https://github.com/AtelierArith/PkgBump.jl")

I’m sure it’s useful to some people’s workflows but I bump my versions as part of feature branches and then it’s much easier to just edit the version number.

For what it’s worth PkgDev has some partially overlapping functionality, but is kind of opinionated.

Is this meant to be used in something like a Github Action for automation?

I wish I could. Perhaps in the future PkgBump will provide a workflow file(for GitHub) or GitLab Runner something like:

name: PkgBump

on:
  workflow_dispatch:

jobs:
    Bump:
          ...

Currently, I’m making this package to help me do my job, calling bumpxxx functions locally.

Yes, thank you for your advise. This is much simpler than my instructions.

PkgDev has some partially overlapping functionality

Good to know. I need to investigate. :wink: