Skip to content

Commit b45871a

Browse files
ehdsouzagermanattanasio
authored andcommitted
fix(semantic-release): Automation of releases (#517)
1 parent 4859f09 commit b45871a

File tree

5 files changed

+36
-42
lines changed

5 files changed

+36
-42
lines changed

Diff for: .bumpversion.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[bumpversion]
22
current_version = 1.5.0
33
commit = True
4-
tag = True
54

65
[bumpversion:file:watson_developer_cloud/version.py]
76
search = __version__ = '{current_version}'

Diff for: .releaserc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"branch": "master",
3+
"verifyConditions": [],
4+
"prepare": [
5+
{
6+
"path": "@semantic-release/exec",
7+
"cmd": "bumpversion --current-version ${lastRelease.version} --new-version ${nextRelease.version} patch"
8+
}
9+
],
10+
"publish": [
11+
{
12+
"path": "@semantic-release/github",
13+
}
14+
]
15+
}

Diff for: .travis.yml

+19-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ cache: pip
99
before_install:
1010
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && openssl aes-256-cbc -K $encrypted_cebf25e6c525_key
1111
-iv $encrypted_cebf25e6c525_iv -in .env.enc -out .env -d || true'
12-
install: pip install tox-travis
12+
- npm install npm@latest -g
13+
install:
14+
- pip install tox-travis
15+
- pip install bumpversion
16+
- npm install @semantic-release/exec
1317
script:
1418
- pip install -U python-dotenv
1519
- tox
@@ -18,9 +22,17 @@ before_deploy:
1822
- pip install -r requirements-dev.txt
1923
- pip install --editable .
2024
deploy:
21-
provider: script
22-
script: docs/publish.sh
23-
skip_cleanup: true
24-
on:
25-
python: '2.7'
26-
all_branches: true
25+
- provider: script
26+
script: docs/publish.
27+
skip_cleanup: true
28+
- provider: script
29+
script: npx semantic-release
30+
skip_cleanup: true
31+
- provider: pypi
32+
user: ehdsouza
33+
password:
34+
secure: eMssjS1Airz5MrmcEDAnKYnTlMLuzinX8JFsh4TB0A4t7GCes2a/mlvcoazAv2QZMQUKQMC++bAXYGGgXtsSQsfOYnRtojW4pRphxOZrlXlWFgCLGz/eHioamNZVbH+/P/OYjbLy5ZKSzp3M3bZxYqHcmGTq0sBeo5A2Ilkzu5P+D865Jqtn52brwh/xYq4XWeJeQN/BSLwdtPEtZYQXhQupAteNDAo2ON0FVyt0amINrjA0Qw+0k35g36wti+CsKn5fhbaHf6jjN0oRj8J8wPZieXLAUMdxscfBjUXJ8AK8E4H/wPI30IsaMus+1r85ekiDKZC5iukO6uqMARFywjX/eTIDbWxwKImQUgvVa2+gncre7GvZrHIFxhIDDkssH1IfC1fcw3mNY4vCO9df/vHStp3Kvi27GvsYJnfsbXXj6fAhokHtsrnrbpXFET6LghGQx3HgOKrlCQ1EI0Fk92Qw7+g15jwMGlkwUE1qMS+PVOe7dQ4ikxJgw4CVrqU6/zaLFHV8LXFfjv166ZSWcOJHJXGgJ2TPuGiooL60+pWp/UYY00hZVlYX0Vlks6zN0h9zJd16kR3EwDrW0muqFnLC2xTuv5WsCjsOATtsTQzmBNEdCbGdOskgF4+0yPe7ps3kEs3UpAooKtYVh1OOJAUkl4vSMyu4Jg1ASyQWt00=
35+
repository: https://upload.pypi.org/legacy
36+
skip_cleanup: true
37+
on:
38+
python: '2.7'

Diff for: CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ If you want to contribute to the repository, here's a quick guide:
2424
* Make sure your code supports Python 2.7, 3.4, 3.5 and 3.6. You can use `pyenv` and `tox` for this
2525
1. Make the test pass
2626
1. Commit your changes
27+
* Commits should follow the [Angular commit message guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines). This is because our release tool uses this format for determining release versions and generating changelogs. To make this easier, we recommend using the [Commitizen CLI](https://github.com/commitizen/cz-cli) with the `cz-conventional-changelog` adapter.
2728
1. Push to your fork and submit a pull request to the `dev` branch
2829

2930
## Running the tests

Diff for: RELEASES.md

+1-34
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,3 @@
11
# Release process
22

3-
Standard practice with pypi libraries is to commit all of the changes for a release except updating the version. We use [bumpversion] to update the version file, commit, and tag the changes.
4-
5-
## 1. Updating the version
6-
7-
A small command line tool to simplify releasing software by updating all version strings in your source code by the correct increment.
8-
9-
Install it with:
10-
11-
```bash
12-
pip install bumpversion
13-
```
14-
15-
## 2. Doing a release
16-
17-
(The pypandoc module should be installed on the system doing the release, to generate the documentation for pip.)
18-
19-
```sh
20-
bumpversion major|minor|patch
21-
git push origin master
22-
git push origin --tags
23-
python setup.py publish
24-
```
25-
26-
`bumpversion *` will update the version field appropriately, create a git commit and tag for the version, and publish the tag to github.
27-
28-
`git push origin master` will publish the changes to package.json.
29-
30-
`git push origin --tags` will publish the tag to github., and then immediately.
31-
32-
`python setup.py publish` will publish the module to pypi.
33-
34-
The reason for this is that it allows someone to easily view the source code (and readme) for whatever version they happen to have downloaded from pypi. This is particularly helpful when github is ahead of pypi.
35-
36-
[bumpversion]: https://pypi.python.org/pypi/bumpversion
3+
The semantic-release automates the whole package release workflow including: determining the next version number, generating the release notes and publishing to pypi.

0 commit comments

Comments
 (0)