-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (52 loc) · 1.67 KB
/
pypi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Deploy wheel on PyPI
on:
push:
tags:
- '*'
jobs:
publish:
name: 📦 PyPI 🐍
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# tags needed for dynamic versioning
fetch-depth: 0
- name: Set up Python 🐍
id: setup-python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-path: ~/.virtualenvs
installer-parallel: true
- name: Cache Poetry virtualenv
uses: actions/cache@v2
id: cache
with:
path: ~/.virtualenvs
key: ${{ runner.os }}-py-${{ steps.setup-python.outputs.python-version }}-poetry-${{ hashFiles('poetry.lock') }}
- name: Install version management tool
run: |
# same poetry env
PIP="$(head -n1 $(which poetry) | cut -c 3-) -m pip"
${PIP} install poetry-dynamic-versioning
- name: Install dependencies
run: poetry install --no-interaction --no-root ${{ inputs.poetry-extras }}
working-directory: package
if: steps.cache.outputs.cache-hit != 'true'
- name: Install project
run: poetry install --no-interaction
working-directory: package
- name: Package the distribution
run: |
# package the pure python wheel
poetry build
working-directory: package
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: package/dist/