-
Notifications
You must be signed in to change notification settings - Fork 5
138 lines (123 loc) · 4.66 KB
/
action.yml
File metadata and controls
138 lines (123 loc) · 4.66 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Build Wheels
on:
push:
branches:
- main
paths-ignore:
- "docs/**"
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
build_wheels:
if: contains(github.event.head_commit.message, '[build]')
name: Build wheels on ${{ matrix.os }} for ${{ matrix.python_version }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [macos, ubuntu, windows]
python_version: ["3.9", "3.10"]
steps:
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Clone GitHub repository
run: |
git clone --recurse-submodules https://github.com/openPupil/PyPupilEXT
- name: Install dependencies
run: |
cd PyPupilEXT
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Get latest Cmake and ninja (All-Systems)
uses: lukka/get-cmake@latest
- uses: knicknic/os-specific-run@v1.0.4
with:
macos: |
echo "Starting on macOS"
brew install pkg-config
brew install cmake
brew install nasm
brew install gcc
brew install llvm
brew install libomp
brew install libmpc
brew install tree
brew install libxcb
linux: |
echo "Starting on Linux"
sudo apt-get update
sudo apt-get install -y gcc g++ make cmake
sudo apt-get install -y wget git build-essential curl zip unzip tar pkg-config libopencv-dev ninja-build autoconf \
automake libtool bison gperf libx11-dev libxft-dev libxext-dev libegl1-mesa-dev libgles2-mesa-dev libxrandr-dev \
libglib2.0-dev libxrandr-dev libxcursor-dev libxinerama-dev libxi-dev libxcomposite-dev libatk1.0-dev libcairo2-dev libpango1.0-dev \
libgdk-pixbuf2.0-dev libxdamage-dev nasm libomp-dev libomp5 libeigen3-dev
windows: |
echo "Starting on Windows"
cd PyPupilEXT/3rdparty/vcpkg
git checkout 9558037875497b9db8cf38fcd7db68ec661bffe7
git pull
- name: Restore artifacts, or setup vcpkg (All-Systems)
if: matrix.os == 'windows'
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: "${{ github.workspace }}/PyPupilEXT/3rdparty/vcpkg"
vcpkgJsonGlob: "**/vcpkg.json"
runVcpkgInstall: false
vcpkgGitCommitId: 9558037875497b9db8cf38fcd7db68ec661bffe7
- name: Restore artifacts, or setup vcpkg (All-Systems)
if: matrix.os == 'macos' || matrix.os == 'ubuntu'
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: "${{ github.workspace }}/PyPupilEXT/3rdparty/vcpkg"
vcpkgJsonGlob: "**/vcpkg.json"
runVcpkgInstall: false
vcpkgGitCommitId: "e99d9a4facea9d7e15a91212364d7a12762b7512"
- name: Build wheels for Python ${{ matrix.python_version }} in ${{ runner.os }}
run: |
cd PyPupilEXT
python setup.py sdist bdist_wheel
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python_version }}
path: PyPupilEXT/dist/
create_release:
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
if: startsWith(github.ref, 'refs/tags/')
uses: actions/download-artifact@v4
with:
name: "wheels-*"
path: dist/
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: release_notes/release_notes_${{ github.ref }}.md
draft: false
prerelease: false
- name: Upload Release Assets
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "dist/*"
asset_name: ${{ github.ref }}-$(basename ${{ runner.arch }}).whl
asset_content_type: application/zip
# - name: Publish to PyPI
# if: startsWith(github.ref, 'refs/tags/')
# run: |
# python -m pip install --upgrade twine
# python -m twine upload dist/*
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}