-
Notifications
You must be signed in to change notification settings - Fork 12
35 lines (33 loc) · 1.04 KB
/
publish.yaml
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
name: Publish to Pypi
on:
workflow_dispatch:
release:
types: ["published"]
jobs:
lint:
name: "Package and Publish"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('test-requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r test-requirements.txt --upgrade --upgrade-strategy eager
pip install setuptools wheel twine --upgrade --upgrade-strategy eager
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Deploy
run: |
python3 -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}