-
Notifications
You must be signed in to change notification settings - Fork 291
39 lines (37 loc) · 1016 Bytes
/
publish.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
name: Build Python package (and upload to PyPI on tags)
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "constraints*.txt"
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- run: python -m pip install -c constraints.txt build twine
- run: python -m build
- run: twine check dist/*
- name: Publish release
if: github.event_name == 'push' && github.ref_type == 'tag'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: python -m twine upload dist/*