-
Notifications
You must be signed in to change notification settings - Fork 32
56 lines (49 loc) · 1.32 KB
/
actions.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
56
name: Format Code
on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types: [published, edited]
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: pip install ruff
- name: Check code with ruff
run: ruff check .
- name: Format code with ruff
run: ruff format .
deploy:
needs: [format]
name: deploy to pypi
runs-on: ubuntu-latest
# this checks that the commit is a tagged commit
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'edited')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build a binary wheel and a source tarball
run: |
python -m build .
# push all tagged versions to pypi.org
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}