Skip to content

Migrated nightly build/release to GitHub Actions #1448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 10, 2020
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
56 changes: 56 additions & 0 deletions .github/workflows/binaries-nightly-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Nightly Releases

on: pull_request
#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"
UPLOAD_USER: "vfdev-5"
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}
env:
PYPI_USER: ${{ secrets.PYPI_USER }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine check dist/*
TWINE_USERNAME="$PYPI_USER" TWINE_PASSWORD="$PYPI_TOKEN" twine upload --repository-url https://test.pypi.org/legacy/ --verbose dist/*

#TWINE_USERNAME="$PYPI_USER" TWINE_PASSWORD="$PYPI_TOKEN" twine upload --verbose dist/*
2 changes: 1 addition & 1 deletion .github/workflows/pytorch-version-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on:
on:
schedule:
# Run at 00:00 UTC Every Day
- cron: '0 0 * * *'
Expand Down
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 {}