A KISS solution to easily create project releases.
- Minimal. No 3rd-party dependency is necessary, only Python 3.x.
- Simple. All required parameters are automagically detected.
- Language agnostic. Create releases for projects written in any language.
- CI/CD ready. Easily integratable in CI/CD pipelines.
release.py
is a tool that generates releases on GitHub. It
should be used in the context of a CI/CD pipeline, at the delivery stage. The
pipeline should be declared in a way that, when a new tag is pushed,
release.py
is executed after the tests passed, so a new release is
automatically created with the changelog since the last tag.
An example of a Travis-CI pipeline using stages and release.py
:
sudo: required
language: node_js
stages:
- test
- release
jobs:
include:
- stage: test
name: "Unit tests"
install:
- npm install
script:
- npm test
- stage: release
name: "Create new release"
script:
- curl -fsSL https://git.io/fjOZZ | python3
if: tag IS present
The tool lists all the tags for the project and compare the changes from the last tag to the current one -- If no last tag is detected, it will use the master branch as the last reference. It then formats the log to an HTML changelog and posts to the GitHub API. The username, repository name, connection protocol (HTTPS or SSH) and provider (GitHub or others) detection is based upon the remote URL of the repository.
Via CLI, one or more artifacts can be attached to the release. A release
message can also be defined (optionally). The API authentication to either
GitHub is made by tokens. The token should be generated for you account and
exposed inside the pipeline via the RELEASEPY_AUTH_TOKEN
environment
variable.
release.py
only requires Python 3 (version 3.6
or higher).
curl -fsSL https://git.io/fjOZZ | python3
TODO
To the extent possible under law, Caian Rais Ertl has waived all copyright and related or neighboring rights to this work.
release.py
is highly inspired (by functionality or implementation) on these
projects/scripts:
upload-github-release-asset.sh
by Stefan Buckrelease
by Nicolás Sanguinettigithub-release-api
by Patrick DurandGoReleaser
by the GoReleaser Contributors
Icons made by Icongeek26 from Flaticon is licensed by CC 3.0 BY.