Skip to content

Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #200

Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #200

Workflow file for this run

# This workflow is used to build all the wheels and source distributions for
# the project and, on tags and releases, upload them. It is enabled on every
# commit to ensure that the wheels can be built on all platforms, but releases
# are only triggered in two situations:
#
# 1. When a tag is created, the workflow will upload the package to
# test.pypi.org.
# 2. When a release is made, the workflow will upload the package to pypi.org.
#
# It is done this way until PyPI has draft reviews, to allow for a two-stage
# upload with a chance for manual intervention before the final publication.
name: Build and release
on:
push:
release:
types: [created]
jobs:
build_sdist:
runs-on: 'ubuntu-22.04'
name: Build sdist
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install 'tox>=4.0'
- name: Build sdist
run: tox -e build -- -s
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
build_manylinux_wheels:
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
platform:
- 'manylinux1_x86_64'
- 'manylinux1_i686'
- 'manylinux2014_aarch64'
name: Build a ${{ matrix.platform }} for ${{ matrix.python_tag }}
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
if: ${{ matrix.platform == 'manylinux2014_aarch64' }}
name: Set up QEMU
- name: Install docker image
run: |
DOCKER_IMAGE="quay.io/pypa/${{ matrix.platform }}"
echo "DOCKER_IMAGE=$DOCKER_IMAGE" >> $GITHUB_ENV
docker pull $DOCKER_IMAGE
- name: Build wheels
env:
PYTHON_TAGS: "cp36-cp36m cp37-cp37m cp38-cp38"
PRE_CMD: ${{ matrix.platform == 'manylinux1_i686' && 'linux32' || '' }}
run: |
echo "$name"
docker run --rm \
-e PLAT=${{ matrix.platform }} \
-e PYTHON_TAGS="$PYTHON_TAGS" \
-v `pwd`:/io "$DOCKER_IMAGE" \
$PRE_CMD \
/io/scripts/build_manylinux_wheels.sh
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
build_wheel:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python_version: [ '3.7', '3.8' ]
arch: [ 'x86', 'x64' ]
os:
- 'windows-2022'
- 'macos-11'
include:
- { python_version: "3.6", os: "windows-2019", arch: "x86" }
- { python_version: "3.6", os: "windows-2019", arch: "x64" }
- { python_version: "3.6", os: "macos-10.15", arch: "x64" }
exclude:
- os: 'macos-11'
arch: 'x86'
name: 'Build wheel: ${{ matrix.os }} ${{ matrix.python_version }} (${{ matrix.arch }})'
steps:
- uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/[email protected]
if: startsWith(matrix.os, 'windows-')
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
architecture: ${{ matrix.arch }}
- name: Install dependencies
run: |
python -m pip install -U pip
pip install -U 'tox>=3.18'
- name: Create tox environment
run: tox -e build --notest
- name: Build wheel
env:
CL: ${{ startsWith(matrix.os, 'windows-') && '/WX' || '' }}
run: |
tox -e build -- -w
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
deploy:
runs-on: 'ubuntu-22.04'
needs: [build_sdist, build_wheel, build_manylinux_wheels]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- uses: actions/[email protected]
with:
name: dist
path: dist
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install 'tox>=4.0'
- name: Check that version and tag matches
if: >-
startsWith(github.ref, 'refs/tags')
run: tox -e check-version-tag
- name: Run twine check
run: tox -e build-check
- name: Publish package
if: >-
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) ||
(github.event_name == 'release')
env:
TWINE_USERNAME: "__token__"
run: |
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
export TWINE_REPOSITORY_URL="https://test.pypi.org/legacy/"
export TWINE_PASSWORD="${{ secrets.TEST_PYPI_UPLOAD_TOKEN }}"
elif [[ "$GITHUB_EVENT_NAME" == "release" ]]; then
export TWINE_REPOSITORY="pypi"
export TWINE_PASSWORD="${{ secrets.PYPI_UPLOAD_TOKEN }}"
else
echo "Unknown event name: ${GITHUB_EVENT_NAME}"
exit 1
fi
tox -e release