Skip to content

Bump pip from 22.3.1 to 23.2.1 #761

Bump pip from 22.3.1 to 23.2.1

Bump pip from 22.3.1 to 23.2.1 #761

Workflow file for this run

name: Python package
on:
push:
branches: [ develop ]
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches: [ develop ]
jobs:
# https://github.com/actions/runner/issues/1138
check_secrets:
runs-on: ubuntu-latest
outputs:
HAS_TEST_PYPI_PASSWORD: ${{ steps.check.outputs.HAS_TEST_PYPI_PASSWORD }}
steps:
- run: >
echo "::set-output name=HAS_TEST_PYPI_PASSWORD::${{ env.TEST_PYPI_PASSWORD != '' }}";
id: check
env:
TEST_PYPI_PASSWORD: ${{ secrets.test_pypi_password }}
build_tflite:
needs: []
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8']
include:
- python-version: '3.8'
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make venv-create SYSTEM_PYTHON=python
make dev-install-tflite
- name: Test with pytest
run: |
make dev-pytest-tflite
build:
needs: ["check_secrets"]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
include:
- python-version: '3.8'
push-package: true
- os: windows-2019
python-version: '3.8'
- os: macos-latest
python-version: '3.8'
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make dev-venv SYSTEM_PYTHON=python
- name: Lint
run: |
make dev-lint
- name: Test with pytest
run: |
make dev-pytest
- name: Build dist
if: matrix.push-package == true
run: |
make dev-remove-dist dev-build-dist dev-list-dist-contents dev-test-install-dist
- name: Publish distribution to Test PyPI
if: >
matrix.push-package == true
&& needs.check_secrets.outputs.HAS_TEST_PYPI_PASSWORD == 'true'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
if: matrix.push-package == true && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
docker-build:
runs-on: ubuntu-latest
steps:
- name: Set tags
id: set_tags
run: |
DOCKER_IMAGE=de4code/tf-bodypix
VERSION=""
if [[ $GITHUB_REF == refs/tags/v* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
fi
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest"
else
TAGS="${DOCKER_IMAGE}_unstable:${GITHUB_SHA},${DOCKER_IMAGE}_unstable:latest"
fi
echo "TAGS=${TAGS}"
echo ::set-output name=tags::${TAGS}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
if: ${{ env.DOCKERHUB_USERNAME != '' }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.set_tags.outputs.tags }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}