-
Notifications
You must be signed in to change notification settings - Fork 13
47 lines (47 loc) · 1.58 KB
/
publish.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
name: Publish PyPi package for all platforms
run-name: ${{ github.actor }} publishing freesasa-python
on:
release:
types: [published]
jobs:
Publish:
env:
USE_CYTHON: 1
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
strategy:
matrix:
os: [macos-latest, windows-latest] # we'll use the sdist for linux
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
exclude:
- os: macos-latest
python-version: 3.11
runs-on: ${{ matrix.os }}
steps:
- name: "Check out code"
uses: actions/checkout@v3
- name: "Get upstream C library"
run: git submodule update --init
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
cache: "pip"
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install -r requirements.txt
- name: Run tests
run: python setup.py test
- name: Build package
run: python setup.py bdist_wheel
- name: Build sdist
# same source for all versions
if: ${{ matrix.os == 'macos-latest' && matrix.python-version == '3.10' }}
run: python setup.py sdist
- name: Publish package on Mac
if: ${{ matrix.os == 'macos-latest' }}
run: twine upload --skip-existing dist/*
- name: Publish package on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: twine upload --skip-existing dist\*