-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (44 loc) · 1.29 KB
/
release.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
on:
push:
pull_request:
jobs:
pypi-build-and-publish:
name: Build and upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Poetry
run: |
python -m pip install poetry==1.5.1
- name: Configure poetry
run: |
poetry config virtualenvs.in-project true
- name: Cache the virtualenv
uses: actions/cache@v2
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
poetry install --with=dev
- name: Install and run pre-commit hooks
run: |
poetry run pre-commit run --all-files
- name: Build package
run: |
poetry build
- name: Build test site
run: |
poetry install -E test
cd test/simple && poetry run mkdocs build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')