| 1 |
name: Release |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
tags: |
| 6 |
- v* |
| 7 |
|
| 8 |
jobs: |
| 9 |
release-pypi: |
| 10 |
name: release-pypi |
| 11 |
runs-on: ubuntu-latest |
| 12 |
|
| 13 |
# FIXME |
| 14 |
# help test shouldn't depends on this to run |
| 15 |
services: |
| 16 |
redis: |
| 17 |
image: redis:5 |
| 18 |
ports: |
| 19 |
- 6379:6379 |
| 20 |
options: --entrypoint redis-server |
| 21 |
|
| 22 |
steps: |
| 23 |
- uses: actions/checkout@v2 |
| 24 |
- uses: actions/setup-python@v5 |
| 25 |
with: |
| 26 |
python-version: 3.12 |
| 27 |
architecture: 'x64' |
| 28 |
- name: Cache venv |
| 29 |
uses: actions/cache@v4 |
| 30 |
with: |
| 31 |
path: venv |
| 32 |
# Look to see if there is a cache hit for the corresponding requirements file |
| 33 |
key: ubuntu-latest-poetryenv-${{ hashFiles('poetry.lock') }} |
| 34 |
- name: Install Dependencies |
| 35 |
run: | |
| 36 |
python3 -m venv venv |
| 37 |
. venv/bin/activate |
| 38 |
pip install -U pip |
| 39 |
pip install poetry |
| 40 |
poetry install |
| 41 |
python -c "import sys; print(sys.version)" |
| 42 |
pip list |
| 43 |
- name: Poetry Build |
| 44 |
run: | |
| 45 |
. venv/bin/activate |
| 46 |
poetry build |
| 47 |
- name: Test Build |
| 48 |
run: | |
| 49 |
python3 -m venv fresh_env |
| 50 |
. fresh_env/bin/activate |
| 51 |
pip install dist/*.whl |
| 52 |
|
| 53 |
iredis -h |
| 54 |
iredis help GET |
| 55 |
|
| 56 |
- name: Upload to Pypi |
| 57 |
env: |
| 58 |
PASSWORD: ${{ secrets.PYPI_TOKEN }} |
| 59 |
run: | |
| 60 |
. venv/bin/activate |
| 61 |
poetry publish --username __token__ --password ${PASSWORD} |