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

**URL:** <https://discourse.julialang.org/t/ann-pkgbump-jl-automatically-increment-julia-project-file-version/109318>\
**Category:** Package Announcements\
**Tags:** package\
**Created:** [January 26, 2024, 8:33pm UTC](https://discourse.julialang.org/t/ann-pkgbump-jl-automatically-increment-julia-project-file-version/109318 "2024-01-26T20:33:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [January 26, 2024, 8:33pm UTC](https://discourse.julialang.org/t/ann-pkgbump-jl-automatically-increment-julia-project-file-version/109318/1 "2024-01-26T20:33:37Z")

</div>

# [PkgBump.jl](https://github.com/AtelierArith/PkgBump.jl)

Currently this project is WIP.

> **[GitHub - AtelierArith/PkgBump.jl: Automatically increment Julia Project file version](https://github.com/AtelierArith/PkgBump.jl)**
>
> Automatically increment Julia Project file version

## Introduction

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

```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](https://github.com/AtelierArith/PkgBump.jl)

To do this, [PkgBump.jl](https://github.com/AtelierArith/PkgBump.jl) is created. You can install [PkgBump.jl](https://github.com/AtelierArith/PkgBump.jl) by executing the following commands:

```console
$ 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`:

```console
$ 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](https://github.com/AtelierArith/PkgBump.jl)?

---

<div class="post-metadata">

**Author:** ![Krastanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krastanov/32/6817_2.png) [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Post date:** [January 26, 2024, 8:51pm UTC](https://discourse.julialang.org/t/ann-pkgbump-jl-automatically-increment-julia-project-file-version/109318/2 "2024-01-26T20:51:57Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [January 26, 2024, 9:06pm UTC](https://discourse.julialang.org/t/ann-pkgbump-jl-automatically-increment-julia-project-file-version/109318/3 "2024-01-26T21:06:06Z")

</div>

> [@terasakisatoshi](#):
>
> ```julia
> $ git clone https://github.com/AtelierArith/PkgBump.jl
> $ ls
> PkgBump.jl
> $ julia -e 'using Pkg; Pkg.activate(); Pkg.develop(path="PkgBump.jl")'
> 
> ```

It seems easier to do

```julia
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.

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [January 26, 2024, 10:37pm UTC](https://discourse.julialang.org/t/ann-pkgbump-jl-automatically-increment-julia-project-file-version/109318/4 "2024-01-26T22:37:02Z")

</div>

> 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:

```yml
name: PkgBump

on:
  workflow_dispatch:

jobs:
    Bump:
          ...

```

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

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [January 26, 2024, 10:39pm UTC](https://discourse.julialang.org/t/ann-pkgbump-jl-automatically-increment-julia-project-file-version/109318/5 "2024-01-26T22:39:04Z")

</div>

> [@GunnarFarneback](#):
>
> `Pkg.add("https://github.com/AtelierArith/PkgBump.jl")`

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. 😉
