Skip to content

Commit

Permalink
Update release script documentation (#64)
Browse files Browse the repository at this point in the history
* Fix release script

* Update release documentation

* Fix typo
  • Loading branch information
juliaogris authored Feb 8, 2018
1 parent 0f0ebd0 commit ef58a64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
32 changes: 7 additions & 25 deletions docs/releasing.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
Releasing
=========

We intend to automate the releasing process and move it to the CI systems but at the following manual steps are required:
Releasing is automated via a script `src/scripts/releasing.sh`

1. Update `src/sysl/__version__.py` based on the [latest released version](https://github.com/anz-bank/sysl/releases) and [SemVer](https://semver.org/):
Travis creates and deploys `sysl-X.Y.Z-py2-none-any.whl` and `sysl-X.Y.Z.tar.gz` to the [Sysl Github Release page](https://github.com/anz-bank/sysl/releases) and Appveyor adds `sysl.exe`. Travis also deploys Sysl's wheel and sdist distributions to PyPI.

VERSION = (X, Y, Z)
2. Ensure you have a clean repo:
- commit all un-committed changes
- merge with `upstream master` via pull request
- confirm passing CI and local tests
3. Create and push tag `vX.Y.Z`
4. Create a wheel distribution file:
A new release can be started with

> python setup.py bdist_wheel
src/scripts/release.sh prepare X.Y.Z

5. For first time usage only install `twine`
6. For first time usage only set up your `.pypirc` with credentials provided by Sysl core developers:

> pip install twine
> cat `~/.pypirc`
[distutils]
index-servers = pypi
[pypi]
username = <SYSL-CORE-DEV-PROVIDED>
password = <SYSL-CORE-DEV-PROVIDED>


6. Upload to PyPI

> twine upload dist/sysl-X.Y.Z-py2-none-any.whl
and after the automatically generated pull request is approved and merged

src/scripts/release.sh deploy X.Y.Z

will create and push the tag which will trigger Travis and Appveyor to depoy the new release.
5 changes: 3 additions & 2 deletions src/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ if [[ $COMMAND = "prepare" ]]; then
fi
elif [[ $COMMAND = "deploy" ]]; then
PY_VERSION=$(sed -n "s/__version__ = '\\([^ ]*\\)'/\\1/p" src/sysl/__version__.py)
RELEASE_TAG="v$VERSION"
[[ "$VERSION" = "$PY_VERSION" ]] || fatal "Version ($VERSION) different from __version__.py ($PY_VERSION)"
echo "------- Tag release ---------"
git tag "v$VERSION" || fatal "Cannot create tag v$VERSION"
git tag "$RELEASE_TAG" || fatal "Cannot create tag $RELEASE_TAG"
echo "------- Push tag ---------"
git push --tags "$UPSTREAM_URL"
git push "$UPSTREAM_URL" "$RELEASE_TAG"
echo "------- Deployment triggered on Travis and Appveyor ---------"
fi

0 comments on commit ef58a64

Please sign in to comment.