forked from pytorch/ignite
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.54 KB
/
stable-release-pypi.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
name: PyPI Stable Releases
on:
release:
types: [published]
jobs:
build-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: 3.8
- name: Install dependencies
shell: bash -l {0}
run: |
conda install -y pytorch torchvision cpuonly -c pytorch
pip install -r requirements-dev.txt
pip install --upgrade --no-cache-dir twine
python setup.py install
- name: Build and Publish PyPI binaries
shell: bash -l {0}
run: |
python setup.py sdist bdist_wheel
twine check dist/*
TWINE_USERNAME="${{ secrets.PYPI_USER }}" TWINE_PASSWORD="${{ secrets.PYPI_TOKEN }}" twine upload --verbose dist/*
docker-build-publish:
name: Trigger Build and Push Docker images to Docker Hub
needs: build-publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Trigger Circle-CI pipeline
env:
CIRCLE_TOKEN: ${{ secrets.CIRCLE_TOKEN }}
run: |
pip install requests
if [ $GITHUB_EVENT_NAME == 'pull_request' ]; then should_publish_docker_images=false; else should_publish_docker_images=true; fi
branch=$GITHUB_REF
python -u .github/workflows/trigger_circle_ci.py $should_publish_docker_images $branch