Skip to content

Commit

Permalink
Revert "Split workflow into CI and release parts"
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasBommes authored Oct 25, 2024
1 parent 8063e87 commit 0f9bece
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 34 deletions.
78 changes: 76 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
# - builds the Docker image,
# - build wheels for different Python versions,
# - installs the wheel for each Python version and runs the unit tests.
# On manual dispatch this workflow:
# - pushes the previously built Docker image to DockerHub with tag "dev".

name: ci
name: ci and release

on:
push:
Expand Down Expand Up @@ -70,6 +72,46 @@ jobs:
mv-extractor:local \
python3.10 tests/tests.py
# # TODO: run tests on other operating systems than ubuntu-latest
# run_unit_tests:
# name: Run unit tests for python${{ matrix.python }}
# runs-on: ubuntu-latest
# needs: build_docker
# strategy:
# fail-fast: false
# matrix:
# include:
# - python: "3.9"
# - python: "3.10"
# - python: "3.11"
# - python: "3.12"
# - python: "3.13"

# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - name: Download artifact containing Docker image
# uses: actions/download-artifact@v4
# with:
# name: mv-extractor-docker-image
# path: /tmp

# - name: Load Docker image
# run: |
# docker load --input /tmp/image.tar

# - name: Run unit tests for all supported Python versions
# run: |
# docker run \
# -v ${{ github.workspace }}:/home/video_cap \
# mv-extractor:local \
# /bin/bash -c "
# python${{ matrix.python }} -m pip install --upgrade pip && \
# python${{ matrix.python }} -m pip install . && \
# python${{ matrix.python }} tests/tests.py
# "

build_and_test_wheels:
name: Build wheels for cp${{ matrix.python }}-${{ matrix.platform_id }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -137,4 +179,36 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: python-wheel-${{ matrix.python }}
path: ./wheelhouse/*.whl
path: ./wheelhouse/*.whl

# TODO:
# check that tag does not yet exist on DockerHub and PyPI, fail with a message that version has to be bumped in setup.py
# tag image with correct version and "latest" tag
# upload wheels to PyPI
push_docker:
name: Push Docker image to DockerHub
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
needs:
- build_docker
- test_docker
- build_and_test_wheels

steps:
- name: Download artifact containing Docker image
uses: actions/download-artifact@v4
with:
name: mv-extractor-docker-image
path: /tmp

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

- name: Load and push Docker image
run: |
docker load --input /tmp/image.tar
docker tag mv-extractor:local lubo1994/mv-extractor:dev
docker push lubo1994/mv-extractor:dev
32 changes: 0 additions & 32 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit 0f9bece

Please sign in to comment.