Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/binaries-nightly-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Nightly Releases

on:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#onschedule
schedule:
# Run at 00:00 UTC Every Day
- cron: '0 0 * * *'


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.7

- name: Setup nightly version
run: |
sed -i "s/__version__ = \"\(.*\)\"/__version__ = \"\1.dev$(date -u +%Y%m%d)\"/g" ignite/__init__.py
cat ignite/__init__.py

- name: Install dependencies
shell: bash -l {0}
run: |
conda install -y pytorch torchvision cpuonly -c pytorch-nightly
pip install -r requirements-dev.txt
pip install --upgrade --no-cache-dir twine
python setup.py install

- name: Build and Publish Conda binaries
shell: bash -l {0}
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
UPLOAD_USER: "pytorch-nightly"
run: |
chmod +x ./conda.recipe/build_and_upload.sh
./conda.recipe/build_and_upload.sh

- 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/*
34 changes: 34 additions & 0 deletions conda.recipe/build_and_upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

echo "Build and upload Conda binaries"

# ANACONDA_TOKEN should be provided
# How to generate ANACONDA_TOKEN: https://docs.anaconda.com/anaconda-cloud/user-guide/tasks/work-with-accounts#creating-access-tokens
# https://conda.io/docs/user-guide/tasks/build-packages/install-conda-build.html

if [ -z $ANACONDA_TOKEN ]; then
echo "Can not find ANACONDA_TOKEN env variable"
echo "Please, export ANACONDA_TOKEN=<username> before calling this script"
exit 1
fi

if [ -z $UPLOAD_USER ]; then
echo "Can not find UPLOAD_USER env variable"
echo "Please, export UPLOAD_USER=<username> before calling this script"
exit 1
fi

set -xeu

conda install -y conda-build conda-verify anaconda-client
conda config --set anaconda_upload no

conda build --quiet --no-test --output-folder conda_build conda.recipe -c pytorch

# Convert to other platforms: OSX, WIN
conda convert --platform win-64 conda_build/linux-64/*.tar.bz2 -o conda_build/
conda convert --platform osx-64 conda_build/linux-64/*.tar.bz2 -o conda_build/

# Upload to Anaconda
# We could use --all but too much platforms to uploaded
ls conda_build/*/*.tar.bz2 | xargs -I {} anaconda -v -t $ANACONDA_TOKEN upload -u $UPLOAD_USER {}