forked from cowdao-grants/cow-py
-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (73 loc) · 1.89 KB
/
ci.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches: main
release:
types: [released]
jobs:
ci:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [
"3.10", "3.11", "3.12",
]
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
cache-dependency-path: poetry.lock
- name: Poetry lock
run: |
poetry lock
- name: Install dependencies
run: |
poetry install
- name: Typecheck
run: |
poetry run pyright .
- name: Lint
run: |
poetry run ruff check .
- name: Test
run: |
poetry run pytest tests/
- name: Build sdist
run: |
poetry build -f sdist
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: wheels
path: |
dist
- name: Display structure of downloaded files
run: |
ls -R
working-directory: ./
- run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
- run: |
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }}
- name: Publish package (test)
run: |
poetry publish --no-interaction --dry-run -r testpypi -vvv
- if: github.event_name == 'release'
run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
- name: Publish package (prod)
if: github.event_name == 'release'
run: |
poetry publish --no-interaction -vvv