aim packaging pipeline #322
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: aim packaging pipeline | |
on: | |
workflow_call: | |
secrets: | |
PYPI_PASSWORD: | |
required: true | |
DOCKER_HUB_USERNAME: | |
required: true | |
DOCKER_HUB_PASSWORD: | |
required: true | |
inputs: | |
branch: | |
required: true | |
type: string | |
workflow_dispatch: | |
jobs: | |
aim-ui-dist: | |
if: ${{ github.event_name == 'schedule' || github.actor == 'mihran113' || github.actor == 'alberttorosyan' || github.actor == 'roubkar' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ inputs.branch || github.ref }} | |
- name: Use node v16 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Build UI | |
working-directory: ./aim/web/ui | |
run: | | |
npm i --legacy-peer-deps | |
CI=false npm run build | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
architecture: x64 | |
- name: Install dev dependencies | |
run: | | |
python -m pip install -r requirements.dev.txt | |
- name: Build sdist | |
working-directory: ./aim/web/ui | |
run: | | |
python setup.py sdist | |
- name: Publish wheel | |
env: | |
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
working-directory: ./aim/web/ui | |
run: | | |
python -m twine upload -u __token__ -p "${PYPI_PASSWORD}" dist/* | |
linux-dist: | |
if: ${{ github.event_name == 'schedule' || github.actor == 'mihran113' || github.actor == 'alberttorosyan' || github.actor == 'roubkar' }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
manylinux-version: ['manylinux2014_x86_64', 'manylinux_2_24_x86_64', 'manylinux_2_28_x86_64'] | |
name: Linux wheels build (using Docker) ${{ matrix.manylinux-version }} | |
needs: aim-ui-dist | |
steps: | |
- name: Install Docker & pull images | |
run: | | |
apt update && apt install -y docker.io | |
sudo systemctl enable --now docker | |
docker pull quay.io/pypa/${{ matrix.manylinux-version }} | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ inputs.branch || github.ref }} | |
- name: Capture aim version | |
id: capture-version | |
run: | | |
AIM_VERSION=$(< ./aim/VERSION) | |
echo "::set-output name=AIM_VERSION::$AIM_VERSION" | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
architecture: x64 | |
- name: Install dev dependencies | |
run: | | |
python -m pip install -r requirements.dev.txt | |
python -m pip install -r requirements.txt | |
- name: Build bdist wheels for 'cp312-cp312' | |
if: matrix.manylinux-version == 'manylinux_2_28_x86_64' | |
run: | | |
docker run -e PYTHON_VERSION='cp312-cp312' --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh | |
- name: Build bdist wheels for 'cp311-cp311' | |
run: | | |
docker run -e PYTHON_VERSION='cp311-cp311' --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh | |
- name: Build bdist wheels for 'cp310-cp310' | |
run: | | |
docker run -e PYTHON_VERSION='cp310-cp310' --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh | |
- name: Build bdist wheels for 'cp39-cp39' | |
run: | | |
docker run -e PYTHON_VERSION='cp39-cp39' --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh | |
- name: Build bdist wheels for 'cp38-cp38' | |
run: | | |
docker run -e PYTHON_VERSION='cp38-cp38' --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh | |
- name: Build bdist wheels for 'cp37-cp37m' | |
run: | | |
docker run -e PYTHON_VERSION='cp37-cp37m' --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh | |
- name: Publish wheels | |
env: | |
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
python -m twine upload -u __token__ -p "${PYPI_PASSWORD}" multilinux_dist/* | |
- name: Docker login | |
env: | |
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} | |
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
run: docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD | |
- name: Build & Push aim image | |
if: matrix.manylinux-version == 'manylinux_2_24_x86_64' | |
working-directory: ./docker | |
env: | |
AIM_VERSION: ${{ steps.capture-version.outputs.AIM_VERSION }} | |
UPDATE_TAG: ${{ inputs.branch || 'latest' }} | |
run: . create-docker-image.sh | |
macos-dist: | |
if: ${{ github.event_name == 'schedule' || github.actor == 'mihran113' || github.actor == 'alberttorosyan' || github.actor == 'roubkar' }} | |
runs-on: m1 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ] | |
arch: ['arm64', 'x86_64'] | |
exclude: | |
- arch: 'arm64' | |
python-version: 3.7 | |
name: Python ${{ matrix.python-version }} for ${{ matrix.arch }} build | |
env: | |
MACOSX_DEPLOYMENT_TARGET: 10.14 | |
AIM_DEP_DIR: /tmp/aim_run/${{ github.run_number }}/${{ matrix.arch }} | |
PYTHON: /opt/conda/${{ matrix.arch }}/envs/py${{ matrix.python-version }}/bin/python | |
needs: aim-ui-dist | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ inputs.branch || github.ref }} | |
- name: Build bdist wheel | |
run: | | |
arch -${{matrix.arch}} $PYTHON -m build | |
- name: Publish source dist | |
if: matrix.python-version == '3.10' && matrix.arch == 'arm64' | |
env: | |
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
$PYTHON -m twine upload -u __token__ -p "${PYPI_PASSWORD}" dist/*.tar.gz | |
- name: Publish wheel | |
env: | |
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
$PYTHON -m twine upload -u __token__ -p "${PYPI_PASSWORD}" dist/*.whl |