Release a new version of a software based on CHANGELOG.md file.
Project description
Release by Changelog
Release a new version of a software based on CHANGELOG.md file.
Detect the latest version in the CHANGELOG.md file and create a new release in the repository.
Release by Changelog rely on Keep a Changelog format and Semantic Versioning, following those two norms is required.
Installation
pip install --upgrade pip
pip install release-by-changelog
Usage
In a Gitlab CI pipeline, you can use the following command to release a new version of your software based on the CHANGELOG.md file.
release-by-changelog
It's recommended to add a rules
section to run this command only on the default
branch.
Here is an example of a .gitlab-ci.yml
file using release-by-changelog
:
release:
stage: deploy
script:
- pip install release-by-changelog
- release-by-changelog
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
release-by-changelog
will read the CHANGELOG.md file and create a new tag based on the
latest version found in the file. The release will be pushed to the repository.
release-by-changelog
rely on the following predefined CI/CD variables to authenticate
with the GitLab API:
CI_PROJECT_ID
: Used to identify the project,CI_COMMIT_SHA
: Used to identify the reference,CI_JOB_TOKEN
: Used to authenticate with the GitLab API.CI_SERVER_HOST
: Used to identify the GitLab host.
Local usage
You can also use this command locally to release a new version of your software.
release-by-changelog --token <token> <project> <ref>
- project: Path or id on host. [required]
- ref: Can be a branch, tag, or commit SHA. [required]
The token is required to authenticate with the GitLab API. You can authenticate with the GitLab API in several ways:
Using environment variables
You can also use environment variables to avoid passing the token each time. A token passed as an argument will always take precedence over the environment variable.
export PRIVATE_TOKEN=<token>
release-by-changelog <project> <ref>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for release_by_changelog-0.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bc57af212df0fdeaaf59e62d3949e9385b75d0ca8b5057eb4bc8d74c3fdc3b1 |
|
MD5 | 9d43a5f08709141679bd51795265a6b2 |
|
BLAKE2b-256 | 96f09d4178919876954e614341ca5b45bcec969ca8fe7ccbb0d771c846578832 |
Hashes for release_by_changelog-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 940c1c080d9dbd21084c8ff232f6fb6f04f534ddc705924b595d7087fb9ee7bf |
|
MD5 | 8485a0288ed7ec9e7c32a8eda6285e73 |
|
BLAKE2b-256 | 3a868b224a0e32ba2a236edd9e7bc7c2202ae4c0e96e1c3f9a46e21c73a7f0fb |