-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (60 loc) · 1.75 KB
/
Copy pathpublish.yml
File metadata and controls
74 lines (60 loc) · 1.75 KB
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
name: Publish to PyPI
on:
push:
tags:
- 'v*'
workflow_dispatch: # Allows you to run this manually for testing
jobs:
test:
name: Run Automated Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
- name: Install System Dependencies
# Fixes the 'libgl1-mesa-glx' error by using modern packages
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg libgl1 libglx-mesa0 libglib2.0-0
- name: Install PyTorch (CPU)
# Must be installed separately before Detectron2
run: |
pip install torch==2.2.0 torchvision==0.17.0 --index-url https://download.pytorch.org/whl/cpu
pip install ninja wheel setuptools
- name: Install Detectron2
# --no-build-isolation is the key to preventing the 'Getting Requirements' error
run: |
pip install --no-build-isolation git+https://github.com/facebookresearch/detectron2.git
- name: Install Pupil_LIMlab
run: |
pip install -e .
- name: Run Pytest
run: pytest
build-n-publish:
name: Build and publish to PyPI
needs: test
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/Pupil_LIMlab
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build tool
run: pip install build
- name: Build binary
run: |
rm -rf dist/
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1