Skip to content

Commit 0c67bce

Browse files
Merge pull request #28 from ami-iit/pypi
📦 Implement the pypeline to deploy the package to PyPI and TestPyPI
2 parents b3f679d + 84e71aa commit 0c67bce

2 files changed

Lines changed: 93 additions & 3 deletions

File tree

.github/workflows/pypi-ci.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
tags-ignore: [ '**' ]
7+
pull_request:
8+
release:
9+
types:
10+
- published
11+
jobs:
12+
13+
build_wheels:
14+
name: Build wheels [${{ matrix.os }}]
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version:
20+
- 3.8
21+
os:
22+
- ubuntu-20.04
23+
# - macos-latest
24+
# - windows-latest
25+
26+
steps:
27+
28+
- uses: actions/checkout@master
29+
- run: git fetch --prune --unshallow
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v2
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
36+
- name: Install pypa/build
37+
run: pip install build
38+
39+
- name: Build wheel and a source tarball
40+
run: python -m build --sdist --wheel --outdir dist/ .
41+
42+
- name: Archive artifacts
43+
uses: actions/upload-artifact@v2
44+
with:
45+
name: dist
46+
path: dist
47+
48+
49+
deploy_test_PyPI:
50+
name: 📦 Deploy to TestPyPI
51+
runs-on: ubuntu-20.04
52+
needs: [build_wheels]
53+
if: github.ref == 'refs/heads/main'
54+
steps:
55+
56+
- name: Download artifacts
57+
uses: actions/download-artifact@v2
58+
with:
59+
name: dist
60+
path: dist
61+
62+
- name: Publish distribution 📦 to Test PyPI
63+
uses: pypa/gh-action-pypi-publish@master
64+
with:
65+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
66+
repository_url: https://test.pypi.org/legacy/
67+
68+
69+
deploy_PyPI:
70+
name: 📦 Deploy to PyPI
71+
runs-on: ubuntu-20.04
72+
needs: [build_wheels]
73+
if: startsWith(github.ref, 'refs/tags')
74+
steps:
75+
76+
- name: Download artifacts
77+
uses: actions/download-artifact@v2
78+
with:
79+
name: dist
80+
path: dist
81+
82+
- name: Publish distribution 📦 to PyPI
83+
uses: pypa/gh-action-pypi-publish@master
84+
with:
85+
password: ${{ secrets.PYPI_API_TOKEN }}

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ sudo apt install python3.8 python3-virtualenv swig
1414
Clone the repo and install the library:
1515

1616
```console
17-
git clone https://github.com/ami-iit/robot-log-visualizer.git
18-
cd robot-log-visualizer
19-
pip install .
17+
pip install robot-log-visualizer
2018
```
2119

2220
preferably in a [virtual environment](https://docs.python.org/3/library/venv.html#venv-def). For example:
@@ -26,6 +24,13 @@ python3 -m venv visualizer-env
2624
. visualizer-env/bin/activate
2725
```
2826

27+
### 👷 Install latest version (not recommended)
28+
If you want to use the latest feature of the `robot-log-visualizer` you can install it with the
29+
following command
30+
```console
31+
python -m pip install git+https://github.com/ami-iit/robot-log-visualizer.git
32+
```
33+
2934
## 🏃 Example
3035

3136
Once you have install the `robot-log-visualizer` you can run it from the terminal

0 commit comments

Comments
 (0)