Skip to content

Instantly share code, notes, and snippets.

@CCampJr
Last active August 3, 2022 17:01
Show Gist options
  • Save CCampJr/711b7cc8c9faeb5ed6899ee71343a203 to your computer and use it in GitHub Desktop.
Save CCampJr/711b7cc8c9faeb5ed6899ee71343a203 to your computer and use it in GitHub Desktop.
CRIkit Release Protocol

Simplified

  1. git checkout dev
  2. git pull --all
  3. Change version number in init.py NEW VERSION
  4. Change shields and badges in README and index.rst (docs) to point to master branch
  5. git merge master
  6. Commit changes (if needed)
  7. git push
  8. Wait for CI build to complete
  9. git checkout master
  10. git pull --all
  11. git merge --no-ff dev
  12. git tag -a NEW VERSION -m "Version NEW VERSION" (such as 0.1.0)
  13. git push origin VERSION
  14. Wait for CI build to complete
  15. git push
  16. Go to GH and do release from tag

$NEW_VERSION$ for example 0.2.1 $NEXT_VERSION$ for example 0.2.2

With GHActions

  1. git checkout $NEW_VERSION
  2. git pull --all
  3. Change version number in init.py $NEW_VERSION
  4. Change shields and badges in README and index.rst (docs) to point to master branch
  5. git merge master
  6. Commit changes (if needed)
  7. git push
  8. Wait for CI build to complete
  9. git checkout master
  10. git pull --all
  11. git merge --no-ff $NEW_VERSION$ branch
  12. git tag -a $NEW_VERSION$ -m "Version $NEW_VERSION$" (such as 0.1.0)
  13. git push origin VERSION
  14. Wait for CI build to complete
  15. git push

Getting to Release Candidate

  1. git checkout $NEW_VERSION
  2. git pull --all
  3. Change version number in init.py $NEW_VERSIONrc0
  4. Change version in docs/conf.py if need be
  5. Change shields and badges in README and index.rst (docs) to point to master branch
  6. Clean out dist folder
  7. Clean out docs (e.g. make clean)
  8. Rebuild docs (sphinx-apidoc-run.sh)
  9. Commit changes
  10. Wait for CI build to complete
  11. git merge master
  12. Commit changes (if needed)
  13. Wait for CI build to complete
  14. python setup.py sdist
  15. untar from dist folder into a new folder elsewhere
  16. Check contents (NOTE if filenames have changed, sdist cache may use old name -- delete caches)
  17. Within dist folder, python setup.py test (or just pytest.exe if the former fails to find pytest)
  18. If all pass, delete folder and return to module directory
  19. git tag -a $NEW_VERSION$rc0 -m "Test deployment for version $NEW_VERSION$rc0" (such as 0.1.0rc0)
  20. git push origin VERSIONa0
  21. Wait for CI build to complete
  22. twine upload -r testpypi dist/FILEWITHCORRECTVERSION (it will ask for login info)

From RC to Master

  1. Change version number in init.py $NEW_VERSION$
  2. Change version in docs/conf.py if need be
  3. Clean out dist folder
  4. Clean out docs (e.g. make clean)
  5. Rebuild docs (sphinx-apidoc-run.sh)
  6. CHANGELOG Add Date and info to current release
  7. CHANGELOG Next version blank header
  8. Commit changes
  9. git push
  10. Wait for CI build to complete
  11. python setup.py sdist
  12. git tag -a $NEW_VERSION$ -m "Version $NEW_VERSION$"
  13. git push origin $NEW_VERSION$
  14. On GitHub, Add Version $NEW_VERSION$ to title of release and hit Publish
  15. Wait for CI build to complete
  16. twine upload dist/FILEWITHCORRECTVERSION (it will ask for login info)
  17. git checkout master
  18. git pull --all
  19. git merge --no-ff $NEW_VERSION$ branch
  20. git push

Setting Next Branch

  1. git checkout $NEXT_VERSION$ branch
  2. Change version number in init.py $NEXT_VERSIONa0
  3. Change version in docs/conf.py if need be
  4. Change shields and badges in README and index.rst (docs) to point to NEXT_VERSION branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment