Crypto-toolbox / bitex

Crypto-currency Exchange API Framework
MIT License
484 stars 134 forks source link

Automatic versioning for master, dev, and release branches #110

Open deepbrook opened 6 years ago

deepbrook commented 6 years ago

Workflow: In my local git repo, on the dev branch, I tag a new release candidate version, and push this tag upstream. I do not modify the setup.py version.

(/home/nils/anaconda3)nils@chantico:~/git/bitex> git branch
* dev
  master
  nightly
(/home/nils/anaconda3)nils@chantico:~/git/bitex> git tag 2.0.0rc1
(/home/nils/anaconda3)nils@chantico:~/git/bitex> git push origin 2.0.0rc1
(/home/nils/anaconda3)nils@chantico:~/git/bitex> python setup.py sdist && twine upload dist/*

The reason for this is because I tend to forget bumping the version number in setup.py when doing multiple deploys in a short-time. To circumvent this issue, we only deploy on a pushed tag as a failsafe, and take the tag name directly as version name. That also means, that the release branch will always stay the same for the lifetime of the branch.

Workflow

(/home/nils/anaconda3)nils@chantico:~/git/bitex> git branch
  dev
  master
* nightly
(/home/nils/anaconda3)nils@chantico:~/git/bitex> git pull origin dev
(/home/nils/anaconda3)nils@chantico:~/git/bitex> git merge --no-ff dev
(/home/nils/anaconda3)nils@chantico:~/git/bitex> git push
(/home/nils/anaconda3)nils@chantico:~/git/bitex> python setup.py sdist && twine upload dist/*

Workflow In my local git repo, on the master branch, I tag a new release version, and push this tag upstream. I modify the setup.py version to match the branch.

(/home/nils/anaconda3)nils@chantico:~/git/bitex> git branch
  dev
* master
  nightly
(/home/nils/anaconda3)nils@chantico:~/git/bitex> git add setup.py && git commit -m "bumped version to release 2.1.0
(/home/nils/anaconda3)nils@chantico:~/git/bitex> git tag 2.1.0
(/home/nils/anaconda3)nils@chantico:~/git/bitex> git push origin 2.1.0
(/home/nils/anaconda3)nils@chantico:~/git/bitex> python setup.py sdist && twine upload dist/*
deepbrook commented 6 years ago

110.1 and 110.3 aren't possible with travis, since originating branches are not available when a tag is pushed. However, since we can access the tag name with $TRAVIS_TAG we can simply check this, in order to deduce what kind of deploy should be issued.