This tool can assist you to perform deployment of release artifacts.
distriploy is available on pypi:
pip install distriploy
For easier installation and automatic virtual environment management, you can use pipx instead:
pipx install distriploy
pipx inject distriploy pyyaml
Before starting using distriploy
, you need to make sure that:
- The repository you'd like to make a release of has been cloned with ssh (not https);
- The repository contains a
.distriploy.yml
file in its root folder.
See this repo's for inspiration.
The file is YAML, it contains an object with the following members:
release
: release information objectrelease.method
: release method. Supported values are:github
: the project has a github repo.Additional info may be provided if so:
release.remote
: string, optional (defaults toorigin
)The local git repo remote corresponding to github.
postrelease.add_mirror_urls
: bool (defaults tofalse
)Whether to add to the release description a list of mirrors. Limited use because if github is down, the list is not accessible.
Environment variable
GITHUB_TOKEN
, must be populated by user, contains a token string created from https://github.com/settings/tokensSet it up with eg.:
read GITHUB_TOKEN export GITHUB_TOKEN
Or add it to an environment file not under revision control.
mirrors
: mirroring information object, containing members whose key is a mirror handle.Each entry contains:
mirrors.${mirror}.method
: mirroring upload method. Supported values (unsupported are ignored, with a warning) are (TODO):osf
: upload to https://osf.ioUse requires installation with
osf
option, or subsequent installation of theosfclient
dependency.Additional info may be provided if so:
project
: string, OSF project keyfolder
: string, OSF file foldername
: string, optional (defaults to release artifact name)Useful if using OSF's revision system.
Environment variables
OSF_USERNAME
andOSF_PASSWORD
.Set it up with eg.:
read OSF_USERNAME OSF_PASSWORD export OSF_USERNAME OSF_PASSWORD
Or add it to an environment file not under revision control.
rsync
: upload with rsyncAdditional info may be provided if so:
remote
: string, rsync destinationpublic
: string, public URI prefix, accessible once upload is completed
academictorrents
: create torrent file, and upload to https://academictorrents.comThe torrent file will be generated in cwd, named like the release artifact and added
.torrent
extension.Additional info may be provided if so:
params
: object, academictorrents upload params, to be POST'edEnvironment variables
ACADEMICTORRENTS_USERNAME
andACADEMICTORRENTS_PASSWORD
, must be populated by user, they come from uid & pass in https://academictorrents.com/about.php#apikeysSet it up with eg.:
read ACADEMICTORRENTS_USERNAME ACADEMICTORRENTS_PASSWORD export ACADEMICTORRENTS_USERNAME ACADEMICTORRENTS_PASSWORD
Or add it to an environment file not under revision control.
distriploy
is typically called from your repo's root folder using:
distriploy [--revision RELEASE_NAME release]
Run it with --help to get to know the options.
MIT.
read version # eg. 0.14
sed -i -e 's/^version = .*/version = "'${version}'"/g' setup.py
git add setup.py
git commit -m "preparation for v${version}"
git tag --annotate --message "" v${version}
git push; git push --tags
rm -rf dist; python setup.py sdist && twine upload dist/* -r pypi
python -m distriploy