Skip to content

Commit da8502e

Browse files
authored
Merge pull request #17 from britive/develop
pypi
2 parents ca195aa + 10a7b87 commit da8502e

File tree

6 files changed

+82
-10
lines changed

6 files changed

+82
-10
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will upload to Test PyPi a Python Package using Twine when a new release is published
2+
3+
name: Upload Python Package to PyPi
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
deploy:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up Python
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: '3.9'
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install build
27+
- name: Build package
28+
run: python -m build
29+
- name: Publish package
30+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
31+
with:
32+
user: __token__
33+
password: ${{ secrets.PYPI_API_TOKEN }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will upload to Test PyPi a Python Package using Twine when a push to develop branch occurs
2+
3+
name: Upload Python Package to Test PyPi
4+
5+
on:
6+
push:
7+
branches:
8+
- develop
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
deploy:
15+
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python
21+
uses: actions/setup-python@v3
22+
with:
23+
python-version: '3.9'
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build
28+
- name: Build package
29+
run: python -m build
30+
- name: Publish package
31+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
32+
with:
33+
user: __token__
34+
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
35+
repository_url: https://test.pypi.org/legacy/

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ PyBritive is intended to be used as a CLI application for communicating with the
1111

1212
## Installation
1313

14-
`pybritive` will be installed via Python `pip`. The package is not available in PyPi at this time, so it will be
15-
installed via the published tar balls in the GitHub repo. Determine the most recent version that has been published
16-
and add the version below.
14+
`pybritive` will be installed via Python `pip`.
1715

1816
~~~bash
19-
version=x.y.z
20-
pip install https://github.com/britive/python-cli/releases/download/v$version/pybritive-$version.tar.gz
17+
pip install pybritive
2118
~~~
2219

23-
Or you can always pull the latest version using one of the following commands
20+
Or you can always pull the latest version directly from Github using one of the following commands.
2421

2522
~~~
2623
pip install $(curl -s https://api.github.com/repos/britive/python-cli/releases/latest | jq -r '.assets[] | select(.content_type == "application/x-gzip") | .browser_download_url')

TECH_README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ python -m build
2020
* Cut a new release in GitHub with the version tag
2121
* Add the assets from `dist` directory to the release
2222

23+
## Github Actions
24+
There are 2 Github Actions in play that publish to PyPI.
25+
26+
1. Trigger off of a push to the `develop` branch. Will deploy to test PyPI.
27+
2. Trigger off of a new release being published. Will deploy to real PyPI.
28+
2329
## Testing
2430
It is generally advisable to set environment variable `PYBRITIVE_HOME_DIR` to some temp location if you
2531
will be performing the full suite of tests. This will ensure that no changes are made to your existing

requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
https://github.com/britive/python-sdk/releases/download/v2.7.1/britive-2.7.1.tar.gz
1+
britive~=2.7.1
22
certifi==2022.6.15
33
charset-normalizer==2.1.0
44
click==8.1.3
@@ -13,4 +13,5 @@ urllib3==1.26.9
1313
cryptography==37.0.4
1414
pytest==7.1.2
1515
mkdocs==1.3.1
16-
mkdocs-click==0.8.0
16+
mkdocs-click==0.8.0
17+
twine~=4.0.1

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pybritive
3-
version = 0.2.1
3+
version = 0.2.2
44
author = Britive Inc.
55
author_email = support@britive.com
66
description = A pure Python CLI for Britive
@@ -25,7 +25,7 @@ install_requires =
2525
tabulate
2626
toml
2727
cryptography
28-
britive @ https://github.com/britive/python-sdk/releases/download/v2.7.1/britive-2.7.1.tar.gz#egg=britive-2.7.1
28+
britive
2929

3030
[options.packages.find]
3131
where = src

0 commit comments

Comments
 (0)