# Updating COPT.jl to a new COPT version

## Updating to a new technical version

When only the technical version number changes (e.g. from 6.0.2 to 6.0.3), then
only the low-level wrapper needs to be generated for the new version. Use:

```julia
julia> include("scripts/generator.jl")
julia> Generator.generate_wrapper(VersionNumber(6,0,3))
```

This will create a directory src/gen6.0.3.

Note: When the newly generated src/genX.Y.Z/libcopt.jl is identical to the
previous one except for the line "const COPT_VERSION_TECHNICAL = Z", then you
can delete the newly generated directory. When loading the COPT library, COPT.jl
automatically falls back to the low-level wrapper of a previous technical
version if the latest one does not exist.

## Updating to a new major or minor version

When the major or minor version number changes, then in addition to generating
the low-level wrapper, you also need to adjust the installer. In deps/build.jl
search for the old version number (e.g. "40" and "4.0") and add the new one.
Also adjust the "coptdir" variable at the top of src/COPT.jl, e.g. from copt40
to copt50.

## Updating the automatic installation

In order to change the COPT version that is downloaded by the automatic
installer, Artifacts.toml needs to be updated. Use:

```julia
julia> include("scripts/generator.jl")
julia> Generator.generate_artifacts_toml(VersionNumber(7,0,2))
```

## Creating a new release

To create a new release of the Julia interface, which is then automatically
installed when users run Pkg.add/update, do the following steps:
- Increase the version number in Project.toml, e.g. from 1.0.7 to 1.0.8, and
  commit.
- On github, comment "@JuliaRegistrator register" on that commit. This will open
  a registration pull request to https://github.com/JuliaRegistries/General.
  Once the PR is merged (usually after a few minutes), a tag will automatically
  be created for the commit.
