Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Commit 0834b35

Browse files
author
Max Lancaster
committed
Add github workflow to run tests and publish to Fool nexus
1 parent 7a34064 commit 0834b35

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build & Test
2+
3+
on: [ push ]
4+
5+
env:
6+
# we're using an alias here so we can reference it in individual tasks.
7+
# making it global breaks the Publish command for some reason.
8+
PIP_INDEX_URL_VALUE: https://${{secrets.PRIVATE_PYPI_USERNAME}}:${{secrets.PRIVATE_PYPI_PASSWORD}}@nexus.fool.com/repository/fool-pypi/simple/
9+
10+
jobs:
11+
test:
12+
name: Test on Python ${{ matrix.python-version }} 🔎
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
17+
18+
steps:
19+
- uses: actions/checkout@v1
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
pip install -e .
29+
- name: Run Unit Tests
30+
run: python setup.py test
31+
32+
publish:
33+
name: Publish to Nexus ⏫
34+
# only run on tag builds
35+
if: startsWith(github.ref, 'refs/tags')
36+
runs-on: ubuntu-latest
37+
needs: [test]
38+
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: Install Python 🐍 dependencies
42+
run: python -m pip install -U pip && python -m pip install -U setuptools twine wheel
43+
- name: Build 🔨 dist packages
44+
env:
45+
PIP_INDEX_URL: ${{ env.PIP_INDEX_URL_VALUE }}
46+
run: python setup.py sdist bdist_wheel --verbose
47+
- name: Publish 📦
48+
run: python -m twine upload dist/* --verbose
49+
env:
50+
TWINE_USERNAME: ${{ secrets.PRIVATE_PYPI_USERNAME }}
51+
TWINE_PASSWORD: ${{ secrets.PRIVATE_PYPI_PASSWORD }}
52+
TWINE_REPOSITORY_URL: ${{ secrets.PYPI_REPOSITORY_URL }}

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Installation
3232

3333
::
3434

35-
pip install pydiscourse
35+
pip install fool-pydiscourse
3636

3737
Examples
3838
========

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[metadata]
2-
name = pydiscourse
2+
name = fool_pydiscourse
33
version = attr: pydiscourse.__version__
44
author = "Marc Sibson and contributors"
55
author_email = "[email protected]"

src/pydiscourse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
"""Python client for the Discourse API."""
44

5-
__version__ = "1.3.0"
5+
__version__ = "1.4.0"
66

77
from pydiscourse.client import DiscourseClient
88

0 commit comments

Comments
 (0)