Build and distribute
This pages explains how to change Paasify version and publish releases.
Quickstart
There are few operation related to this topic
- Bump version: Increment version and generate changelogs
- Build: Create artifacts, including python packages with changelogs
- publish: Push artifacts onto remote repositories, such as Pypi.org or github release
Bump version
The bump operation consists in:
- Generate latest changes files
- Call
cz
with thebump
command- Update version in
.cz.toml
- Update version in
pyproject.toml
- Generate
CHANGELOG.md
- Commit changed files and commit
- Tag commit with version name
- Update version in
To check what is the next version you would release according your last commits, you can run:
$ task version
task: [version] ./scripts/bump.sh
INFO: Detecting devel branch
INFO: Dry mode enabled, use with --exec to run changes
INFO: Changelog to be generated:
DEBUG: command: cz bump --changelog --dry-run --prerelease alpha
bump: version 0.1.0a0 → 0.1.0a1
tag to create: 0.1.0a1
...
The output is self explanatory, it shows you what is your next direction. The major/minor/patch depends on how you prefixed your commits. Enventually, you can force the context this way:
When you feel agree with the proposed result, you can run it for good, replace version
to bump
, from the previous example:
Build
Build process will build python package with poetry and copy changelogs into the dist
directory
Publish
Artifacts are published on many destinations:
- pypi.org: Python release
- Github Project: Project sources
- Github Release: Github tar.gz release
- Github Pages: Official documentation
- DockerHub: Docker image release (TODO)
- Github Container: Docker image release (TODO)
To publish:
Implementation details
While designing CI/CD system around paasify development, it has been decided to not depend upon
third party tools. Every CI/CD commands must be able to be launched via task
. No github actions or whatever vendor specific tasks,
everything the CI/CD can do the developer should be able to do so.
Everything should be able to run on the developper workstation.
CI/CD
There are some github configurations and workflow defined into the .github
project in the project dir. Because all CI/CD system
is run via task, there is almost no need to configure the CI/CD outside of simply calling task
commands.
Bump
The current project allows a smart and easy versionning operation:
- Uses a plugin that allow to guess its version from its package name (see:
pyproject.toml
)- No need to update python code to bump version
cz
handle version bumping, in our case it will update itselfpyproject.toml
- No need to update python
pyproject.toml
to bump version
- No need to update python
- A
./scripts/bump.sh
script exist to help developer to determine what should be the next version- No need to guess what gonna be named the next version
- You can still override what gonna be the next version
task
is used as main wrapper- For most of case, you can simple alternatce between
task version
andtask bump
- For most of case, you can simple alternatce between
Behind the scene, task
only call the underline script bump.sh
, to get more informations:
$ ./scripts/bump.sh --help
INFO: Detecting devel branch
Helps to bump project version according to git status
Usage: ./scripts/bump.sh [OPTIONS,...]
OPTIONS:
alpha,beta,rc Force version type
major,minor,patch Force version type
INTEGER Positive number for dev releases
EXAMPLES:
./scripts/bump.sh beta
./scripts/bump.sh beta 2
./scripts/bump.sh minor alpha 3
!!! Warning: Be sure you have at least commited one change before If you have not comitted any changes, you should get this error message.
Logo
Paasify official logo is included as a SVG file in the logo/
directory. They are provided as SVG, so they can
easily be patched and commited into git with a vectorial editor tool, such as Inkscape. An
helper script is provided to generate favicon: