-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (51 loc) · 1.4 KB
/
main.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
# .github/workflows/main.yml
---
on:
- push
env:
PYTHONUNBUFFERED: 1
jobs:
test:
strategy:
matrix:
include:
- python: 3.12
- python: 3.7
name: Test
runs-on: ubuntu-latest
steps:
- name: setup python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: upgrade pip
run: pip install --upgrade pip
- name: checkout
uses: actions/checkout@v3
- name: install editable package
run: pip install -e .
- name: Install test dependencies
run: pip install -r ./requirements-test.txt
- name: run unit tests
run: ./unit_tests.sh
pypi-publish:
name: Upload release to PyPI
needs:
- test
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
#if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/clickdc
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: checkout
uses: actions/checkout@v3
- name: install build python package
run: pip install --upgrade build
- name: build the package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1