Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cibuildwheel #19

Merged
merged 17 commits into from
Aug 19, 2022
Prev Previous commit
Next Next commit
extended build action
LukasBommes committed Aug 1, 2022
commit 20693813946eda2992e0cc81ebfba3f9af93f149
80 changes: 80 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build

on: [push, pull_request]

jobs:
build_docker:
name: Build Docker image
runs-on: ubuntu:22.04

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: lubo1994/mv-extractor:dev
cache-from: type=registry,ref=lubo1994/mv-extractor:buildcache
cache-to: type=registry,ref=lubo1994/mv-extractor:buildcache,mode=max

build_wheels:
name: Build wheels for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
runs-on: ${{ matrix.os }}
needs: build_docker_image
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
include:
- os: ubuntu:22.04
python: 38
bitness: 64
platform_id: manylinux_x86_64
manylinux_image: lubo1994/mv-extractor:dev
- os: ubuntu:22.04
python: 39
bitness: 64
platform_id: manylinux_x86_64
manylinux_image: lubo1994/mv-extractor:dev
- os: ubuntu:22.04
python: 310
bitness: 64
platform_id: manylinux_x86_64
manylinux_image: lubo1994/mv-extractor:dev

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_PLATFORM: linux
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
# Disable building PyPy wheels on all platforms
CIBW_SKIP: pp*
CIBW_ARCHS: x86_64
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
#CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
CIBW_BUILD_FRONTEND: build
CIBW_TEST_COMMAND: VIDEO_URL={project}/vid.mp4 python3 {project}/tests/tests.py
CIBW_BUILD_VERBOSITY: 1

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
84 changes: 0 additions & 84 deletions .github/workflows/build_wheels.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ COPY src /home/video_cap/src/

# Install Python package
COPY vid.mp4 /home/video_cap
RUN python3.10 -m pip install --upgrade pip build twine && \
RUN python3.10 -m pip install --upgrade pip build && \
python3.10 -m pip install 'pkgconfig>=1.5.1' 'numpy>=1.17.0'

RUN python3.10 -m pip install .
11 changes: 8 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
@@ -15,10 +15,15 @@ pip install cibuildwheel==2.8.1
cibuildwheel --platform linux

# Build source dist
docker run
#docker run

# upload to PyPI

read -p 'Username: ' pypi_username
read -sp 'Password: ' pypi_password
#read -p 'Username: ' pypi_username
#read -sp 'Password: ' pypi_password

# Upload to TestPyPI
# python3 -m twine upload --repository testpypi dist/*

# Install wheel from TestPyPI
# pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ mv-extractor==1.0.5
2 changes: 2 additions & 0 deletions release.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Create a new release

### Step 1) Push code

#### Create tag and release

```
7 changes: 0 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -33,13 +33,6 @@
ext_modules=[mv_extractor],
packages=find_packages(where='src'),
package_dir={'': 'src'},
#package_dir={'mv_extractor': 'src'},
#package_data={
# 'mv_extractor': [
# 'vid.mp4',
# ''
# ],
#},
entry_points={
'console_scripts': [
'extract_mvs=mv_extractor.__main__:main',