forked from aimhubio/aim
-
Notifications
You must be signed in to change notification settings - Fork 3
167 lines (143 loc) · 5.09 KB
/
python-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
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 == 'gorarakelyan' || 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 == 'gorarakelyan' || github.actor == 'alberttorosyan' || github.actor == 'roubkar' }}
runs-on: ubuntu-latest
strategy:
matrix:
manylinux-version: ['manylinux2014_x86_64', 'manylinux_2_24_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
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_minutes: 30
retry_wait_seconds: 60
command: docker run --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 == 'gorarakelyan' || 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' ]
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