Skip to content

Added automation to publish to test-pypi #1467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/test_pypi_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

name: Publish 📦 to TestPyPI

on:
push:
branches: [ master ]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.CGALLO_TEST_PYPI }}
repository_url: https://test.pypi.org/legacy/
7 changes: 3 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ SoftLayer products and services.

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

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

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

Installation
------------
Expand Down Expand Up @@ -82,7 +81,7 @@ Issues with the Softlayer API itself should be addressed by opening a ticket.
Examples
--------

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

Debugging
---------
Expand Down
68 changes: 62 additions & 6 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,74 @@
# Release steps

* Update version constants (find them by running `git grep [VERSION_NUMBER]`)
* Create changelog entry (edit CHANGELOG.md with a one-liner for each closed issue going in the release)
* Commit and push changes to master with the message: "Version Bump to v[VERSION_NUMBER]"
* Make sure your `upstream` repo is set

# Versions

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.

# Changelog

When doing a release, the Changelog format should be as follows:

```markdown

## [Version] - YYYY-MM-DD
https://github.com/softlayer/softlayer-python/compare/v5.9.0...v5.9.1

#### New Command
- `slcli new command` #issueNumber

#### Improvements
- List out improvements #issueNumber
- Something else that changed #issueNumber

#### Deprecated
- List something that got removed #issueNumber

```

# Normal Release steps

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.


1. Create the changelog entry, us this to update `CHANGELOG.md` and as the text for the release on github.
2. Update the version numbers in these files on the master branch.
- `SoftLayer/consts.py`
- `setup.py`
3. Make sure the tests for the build all pass
4. [Draft a new release](https://github.com/softlayer/softlayer-python/releases/new)
- Version should start with `v` followed by Major.Minor.Revision: `vM.m.r`
- Title should be `M.m.r`
- Description should be the release notes
- Target should be the `master` branch
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.

# Manual Release steps

1. Create the changelog entry, us this to update `CHANGELOG.md` and as the text for the release on github.
2. Update the version numbers in these files on the master branch.
- `SoftLayer/consts.py`
- `setup.py`
3. Commit your changes to `master`, and make sure `softlayer/softlayer-python` repo is updated to reflect that
4. Make sure your `upstream` repo is set

```
git remote -v
upstream [email protected]:softlayer/softlayer-python.git (fetch)
upstream [email protected]:softlayer/softlayer-python.git (push)
```
* 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:

5. Create and publish the package
- Make sure you have `twine` installed, this is what uploads the pacakge to PyPi.
- 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:

```
[server-login]
username:YOUR_USERNAME
password:YOUR_PASSWORD
```

- 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.


*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.