-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (62 loc) · 1.69 KB
/
publish-pypi.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
name: publish-pypi
on:
push:
branches:
- main
jobs:
check_build_trigger:
name: Check build trigger
runs-on: ubuntu-latest
outputs:
build: ${{ steps.check_build_trigger.outputs.build }}
steps:
- name: Checkout scikit-longitudinal
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- id: check_build_trigger
name: Check build trigger
run: bash build_tools/github/check_build_trigger.sh
unit_testing:
runs-on: ${{ matrix.os }}
needs: check_build_trigger
if: needs.check_build_trigger.outputs.build
strategy:
matrix:
python-version: [ 3.9 ]
os: [ ubuntu-latest ]
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Checkout this repository
uses: actions/checkout@v2
- uses: pdm-project/setup-pdm@main
name: Setup PDM
with:
python-version: 3.9
architecture: x64
prerelease: false
enable-pep582: true
- name: Install dependencies from pdm.lock
run: |
pdm install
- name: Run tests
run: pdm run tests
pypi-publish:
name: ☁️ upload release to PyPI
runs-on: ubuntu-latest
needs: [check_build_trigger, unit_testing]
if: |
always() &&
needs.check_build_trigger.outputs.build &&
needs.unit_testing.result == 'success'
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: pdm-project/setup-pdm@v3
- name: Publish package distributions to PyPI
run: pdm publish