Package: reliesl
relieslreliesl helps you automate your releases usingpoetryand GitLab CI."You've had a long day at work. Bugs have been squashed, features wered added and breaking changes documented. You've poured your heart and soul into this piece of software and the last thing seperating you from popping a bottle of champagne is having to release the newest version of your project on GitLab. Thank God there's reliesl to release your new software on GitLab (and maybe even open that bottle of champagne)."
- reliesl's secret admirerUserelieslrelieslgrew up in a small village and thus is pretty opinionated. It assumes you are usingpoetryand keeping aCHANGELOG.md.relieslprovides two different commands to make your release process as smooth as possible:reliesl releaseUsually added to your existing CI pipeline to manually trigger a new GitLab release based on the releasenotes given in CHANGELOG.md. Also adds the .whl of the package to the Asset section.If you want to automatically release to PyPi (or TestPyPi if you are feeling less adventurous) you can use the--pypi-release <pypi|testpypi>option like so:relieslrelease--pypi-release<value>For authentication this requires the environement variablesPYPI_USERNAMEandPYPI_PASSWORDorTESTPYPI_USERNAMEandTESTPYPI_PASSWORDto be set.reliesl bumpUsually run locally to take care of all cumbersome version edits in various files.
It will ask you whether you want to do a pre-release, bug fix, minor or major change, before automatically bumping yourpoetryversion and parsing theCHANGELOG.mdto update theUNRELEASEDsection with the right version number and date.Use the--dry-runflag to see what would happen without changing any files.Additional files where version changes are needed can be configured via--additional-file-edits <file> <regex>, like so:reliesl bump --additional-file-edits "file.txt" '(semver = )(.*)()' "file2.txt" '(version: )(.*)()'The second capture group must be the semantic version you want to change.
For more information on python regular expressions lookhere.InstallrelieslLocalSimply runpoetryadd--devrelieslorpipinstallrelieslGitLab-CITo your .gitlab-ci.yml you need to add:A new- deploystage if you do not already have one (The release process should be the last stage)A new job:release:
  stage: deploy
  when: manual
  script:
    - pip install reliesl
    - reliesl releaseEnvironment VariablesThe release script needs access to the GitLab API to create a new release. This requires a new environment variable(Under Settings > CI / CD > Variables):Key:PRIVATE_TOKENValue: a valid private token that gives access to api calls for your project(Profile > Settings > Access Tokens)DevelopmentPre-commitPlease make sure to have the pre-commit hooks installed.
Installpre-commitand then runpre-commit installto register the hooks with git.MakefileWe usemaketo streamline our development workflow.
Runmake helpto see all available commands.$ make help 
help                 Show this help message
check                Run all static checks (like pre-commit hooks)
test                 Run all tests
dev-install          Install all the packages in the local python environment for development
bump                 Bump reliesl versionAcknowledgmentsThe picture of Liesl was stolen from here:https://ladiesoftheatre.tumblr.com/post/155234955388/you-may-think-this-kind-of-adventure-never-may