-
Notifications
You must be signed in to change notification settings - Fork 8
46 lines (44 loc) · 1.65 KB
/
publish_wheels.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
name: Neurodamus Wheels
on: push
jobs:
wheel:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ["3.11"]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 500
fetch-tags: true
- name: Prerequisites
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo TZ=UTC apt-get -y install tzdata
sudo apt-get update
sudo apt-get install -y python${{ matrix.python_version }} python${{ matrix.python_version }}-distutils python${{ matrix.python_version }}-venv
sudo apt-get install -y curl
sudo curl -sS https://bootstrap.pypa.io/get-pip.py | python${{ matrix.python_version }}
pip3 install pipx
- name: Build Wheel
run: |
cd $GITHUB_WORKSPACE
python${{ matrix.python_version }} -m pip install --upgrade build
# build wheel
python${{ matrix.python_version }} -m build .
- name: Test Wheel
run: |
cd $GITHUB_WORKSPACE
pip3 install tox
DIST_FILE=`ls dist/*whl` && tox --installpkg=$DIST_FILE -e ${{ matrix.python_version }}
- name: Upload Wheel
env:
PYPI_URL: ${{ secrets.PYPI_URL }}
PYPI_USER: ${{ secrets.PYPI_USER }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
pip3 install twine
python${{ matrix.python_version }} -m twine upload --username $PYPI_USER --password $PYPI_PASSWORD --repository testpypi $PYPI_TOKEN dist/*