Skip to content

Commit 9e27d84

Browse files
#1462 Added automation to publish to test-pypi in preperation for fully automating the build process
1 parent 2ba40f9 commit 9e27d84

File tree

3 files changed

+102
-10
lines changed

3 files changed

+102
-10
lines changed
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
2+
3+
name: Publish 📦 to TestPyPI
4+
5+
on:
6+
push:
7+
branches: [ master ]
8+
9+
jobs:
10+
build-n-publish:
11+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
12+
runs-on: ubuntu-18.04
13+
steps:
14+
- uses: actions/checkout@master
15+
- name: Set up Python 3.7
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.7
19+
- name: Install pypa/build
20+
run: >-
21+
python -m
22+
pip install
23+
build
24+
--user
25+
- name: Build a binary wheel and a source tarball
26+
run: >-
27+
python -m
28+
build
29+
--sdist
30+
--wheel
31+
--outdir dist/
32+
.
33+
- name: Publish 📦 to Test PyPI
34+
uses: pypa/gh-action-pypi-publish@master
35+
with:
36+
password: ${{ secrets.CGALLO_TEST_PYPI }}
37+
repository_url: https://test.pypi.org/legacy/

README.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ SoftLayer products and services.
2828

2929
Documentation
3030
-------------
31-
Documentation for the Python client is available at
32-
http://softlayer.github.io/softlayer-python/.
31+
Documentation for the Python client is available at `Read the Docs <https://softlayer-python.readthedocs.io/en/latest/index.html>`_ .
3332

3433
Additional API documentation can be found on the SoftLayer Development Network:
3534

@@ -38,7 +37,7 @@ Additional API documentation can be found on the SoftLayer Development Network:
3837
* `Object mask information and examples
3938
<https://sldn.softlayer.com/article/object-masks>`_
4039
* `Code Examples
41-
<https://softlayer.github.io/python/>`_
40+
<https://sldn.softlayer.com/python/>`_
4241

4342
Installation
4443
------------
@@ -82,7 +81,7 @@ Issues with the Softlayer API itself should be addressed by opening a ticket.
8281
Examples
8382
--------
8483

85-
A curated list of examples on how to use this library can be found at `softlayer.github.io <https://softlayer.github.io/python/>`_
84+
A curated list of examples on how to use this library can be found at `SLDN <https://softlayer.github.io/python/>`_
8685

8786
Debugging
8887
---------

RELEASE.md

+62-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,74 @@
1-
# Release steps
21

3-
* Update version constants (find them by running `git grep [VERSION_NUMBER]`)
4-
* Create changelog entry (edit CHANGELOG.md with a one-liner for each closed issue going in the release)
5-
* Commit and push changes to master with the message: "Version Bump to v[VERSION_NUMBER]"
6-
* Make sure your `upstream` repo is set
2+
3+
# Versions
4+
5+
This project follows the Major.Minor.Revision versioning system. Fixes, and minor additions would increment Revision. Large changes and additions would increment Minor, and anything that would be a "Breaking" change, or redesign would be an increment of Major.
6+
7+
# Changelog
8+
9+
When doing a release, the Changelog format should be as follows:
10+
11+
```markdown
12+
13+
## [Version] - YYYY-MM-DD
14+
https://github.com/softlayer/softlayer-python/compare/v5.9.0...v5.9.1
15+
16+
#### New Command
17+
- `slcli new command` #issueNumber
18+
19+
#### Improvements
20+
- List out improvements #issueNumber
21+
- Something else that changed #issueNumber
22+
23+
#### Deprecated
24+
- List something that got removed #issueNumber
25+
26+
```
27+
28+
# Normal Release steps
29+
30+
A "release" of the softlayer-python project is the current state of the `master` branch. Any changes in the master branch should be considered releaseable.
31+
32+
33+
1. Create the changelog entry, us this to update `CHANGELOG.md` and as the text for the release on github.
34+
2. Update the version numbers in these files on the master branch.
35+
- `SoftLayer/consts.py`
36+
- `setup.py`
37+
3. Make sure the tests for the build all pass
38+
4. [Draft a new release](https://github.com/softlayer/softlayer-python/releases/new)
39+
- Version should start with `v` followed by Major.Minor.Revision: `vM.m.r`
40+
- Title should be `M.m.r`
41+
- Description should be the release notes
42+
- Target should be the `master` branch
43+
5. The github automation should take care of publishing the release to [PyPi](https://pypi.org/project/SoftLayer/). This may take a few minutes to update.
44+
45+
# Manual Release steps
46+
47+
1. Create the changelog entry, us this to update `CHANGELOG.md` and as the text for the release on github.
48+
2. Update the version numbers in these files on the master branch.
49+
- `SoftLayer/consts.py`
50+
- `setup.py`
51+
3. Commit your changes to `master`, and make sure `softlayer/softlayer-python` repo is updated to reflect that
52+
4. Make sure your `upstream` repo is set
53+
754
```
855
git remote -v
956
upstream [email protected]:softlayer/softlayer-python.git (fetch)
1057
upstream [email protected]:softlayer/softlayer-python.git (push)
1158
```
12-
* Push tag and PyPi `python fabfile.py 5.7.2`. Before you do this, make sure you have the organization repository set up as upstream remote, also make sure that you have pip set up with your PyPi user credentials. The easiest way to do that is to create a file at `~/.pypirc` with the following contents:
59+
60+
5. Create and publish the package
61+
- Make sure you have `twine` installed, this is what uploads the pacakge to PyPi.
62+
- Before you do this, make sure you have the organization repository set up as upstream remote, also make sure that you have pip set up with your PyPi user credentials. The easiest way to do that is to create a file at `~/.pypirc` with the following contents:
1363

1464
```
1565
[server-login]
1666
username:YOUR_USERNAME
1767
password:YOUR_PASSWORD
1868
```
69+
70+
- Run `python fabfile.py 5.7.2`. Where `5.7.2` is the `M.m.r` version number. Don't use the `v` here in the version number.
71+
72+
73+
*NOTE* PyPi doesn't let you reupload a version, if you upload a bad package for some reason, you have to create a new version.
74+

0 commit comments

Comments
 (0)