Skip to content

Commit 2b4b081

Browse files
authored
Merge pull request #117 from choldgraf/github_actions_pypi
adding github action to publish to pypi
2 parents e306c6d + 5edcab6 commit 2b4b081

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

.github/workflows/tests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: continuous-integration
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
publish:
8+
9+
name: Publish to PyPi
10+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout source
14+
uses: actions/checkout@v2
15+
- name: Set up Python 3.7
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.7
19+
- name: Build package
20+
run: |
21+
pip install wheel
22+
python setup.py sdist bdist_wheel
23+
- name: Publish
24+
uses: pypa/[email protected]
25+
with:
26+
user: __token__
27+
password: ${{ secrets.PYPI_KEY }}

RELEASE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Release instructions for jupyter-sphinx
2+
3+
Jupyter Sphinx uses a GitHub action to automatically push a new release to
4+
PyPI when a GitHub release is added.
5+
6+
To cut a new Jupyter Sphinx release, follow these steps:
7+
8+
* Ensure that all tests are passing on master.
9+
* In [`_version.py`](https://github.com/jupyter/jupyter-sphinx/blob/master/jupyter_sphinx/_version.py),
10+
change the "release type" section to "final" e.g.:
11+
12+
```python
13+
version_info = (0, 2, 3, "final")
14+
```
15+
* Make a release commit and push to master
16+
17+
```
18+
git add jupyter_sphinx/_version.py
19+
git commit -m "RLS: 0.2.3"
20+
git push upstream master
21+
```
22+
* [Create a new github release](https://github.com/jupyter/jupyter-sphinx/releases/new).
23+
The target should be **master**, the tag and the title should be the version number,
24+
e.g. `0.2.3`.
25+
* Creating the release in GitHub will push a tag commit to the repository, which will
26+
trigger [a GitHub action](https://github.com/jupyter/jupyter-sphinx/blob/master/.github/workflows/artifacts.yml)
27+
to build `jupyter-sphinx` and push the new version to PyPI.
28+
[Confirm that the version has been bumped](https://pypi.org/project/jupyter-sphinx/).
29+
* In [`_version.py`](https://github.com/jupyter/jupyter-sphinx/blob/master/jupyter_sphinx/_version.py),
30+
bump the minor version and change the "release type" section to "alpha" e.g.:
31+
32+
```python
33+
version_info = (0, 2, 4, "alpha")
34+
```
35+
* That's it!

0 commit comments

Comments
 (0)