-
-
Notifications
You must be signed in to change notification settings - Fork 4
43 lines (37 loc) · 1.04 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
name: release
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- uses: actions/checkout@v4
- name: Load cached Poetry installation
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-lin-1 # increment to reset cache
- name: Install Poetry
uses: snok/install-poetry@v1.3.4
with:
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Publish to PyPi
if: startsWith(github.ref, 'refs/tags/')
run: |
set -xeu -o pipefail
poetry config pypi-token.pypi $PYPI_TOKEN
poetry build
poetry publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}