From f2ba0a4aa9949f6b30d60f4f7fef232021fabe4c Mon Sep 17 00:00:00 2001 From: Jeff Yang Date: Sat, 24 Oct 2020 19:10:47 +0630 Subject: [PATCH 1/8] Update setup.cfg --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.cfg b/setup.cfg index 00608f0487c..cae9c515334 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,3 +28,5 @@ markers = distributed: mark a test with distributed option multinode_distributed: mark a test with multi-node distributed option tpu: mark a test as requiring XLA +addopts = + --color=yes From 2c69decfe78fb09dff857bec6f7a95eecce63f52 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 11:36:59 +0630 Subject: [PATCH 2/8] [ci] create binaries-release.yml --- .github/workflows/binaries-release.yml | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/binaries-release.yml diff --git a/.github/workflows/binaries-release.yml b/.github/workflows/binaries-release.yml new file mode 100644 index 00000000000..894b9970345 --- /dev/null +++ b/.github/workflows/binaries-release.yml @@ -0,0 +1,50 @@ +name: Stable Releases + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v2 + with: + miniconda-version: "latest" + python-version: 3.7 + + - name: Install dependencies + shell: bash -l {0} + run: | + conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch + pip install -r requirements-dev.txt + python setup.py install + + - name: Before deploy + shell: bash -l {0} + env: + ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + PYTORCH_CHANNEL: pytorch + UPLOAD_USER: pytorch + run: | + # ANACONDA_TOKEN should be provided by GitHub + # 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 + 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 {} + + # https://github.com/pypa/gh-action-pypi-publish + - name: PyPI deploy + shell: bash -l {0} + uses: pypa/gh-action-pypi-publish@v1.4.1 + with: + user: ${{ secrets.PYPI_USER }} + password: ${{ secrets.PYPI_TOKEN }} From b17839dae73c45ff5e813d7770f9df4504105d10 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 16:41:55 +0630 Subject: [PATCH 3/8] align with nightly release --- .github/workflows/binaries-release.yml | 34 +++++++++----------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/.github/workflows/binaries-release.yml b/.github/workflows/binaries-release.yml index 894b9970345..acfbcc97331 100644 --- a/.github/workflows/binaries-release.yml +++ b/.github/workflows/binaries-release.yml @@ -5,7 +5,7 @@ on: types: [created] jobs: - deploy: + stable_publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -19,32 +19,22 @@ jobs: run: | conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch pip install -r requirements-dev.txt + pip install --upgrade --no-cache-dir twine python setup.py install - - name: Before deploy + - name: Build and Publish Conda binaries shell: bash -l {0} env: ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} - PYTORCH_CHANNEL: pytorch - UPLOAD_USER: pytorch + PYTORCH_CHANNEL: "pytorch" + UPLOAD_USER: "pytorch" run: | - # ANACONDA_TOKEN should be provided by GitHub - # 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 - 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 {} + chmod +x ./conda.recipe/build_and_upload.sh + ./conda.recipe/build_and_upload.sh - # https://github.com/pypa/gh-action-pypi-publish - - name: PyPI deploy + - name: Build and Publish PyPI binaries shell: bash -l {0} - uses: pypa/gh-action-pypi-publish@v1.4.1 - with: - user: ${{ secrets.PYPI_USER }} - password: ${{ secrets.PYPI_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine check dist/* + TWINE_USERNAME="${{ secrets.PYPI_USER }}" TWINE_PASSWORD="${{ secrets.PYPI_TOKEN }}" twine upload --verbose dist/* From b347eaeb78145ae63f89d7d0bd675690f2ed2d69 Mon Sep 17 00:00:00 2001 From: vfdev Date: Tue, 24 Nov 2020 18:04:25 +0100 Subject: [PATCH 4/8] Update binaries-release.yml --- .github/workflows/binaries-release.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/binaries-release.yml b/.github/workflows/binaries-release.yml index acfbcc97331..e38a12d6e3d 100644 --- a/.github/workflows/binaries-release.yml +++ b/.github/workflows/binaries-release.yml @@ -5,11 +5,13 @@ on: types: [created] jobs: - stable_publish: + build-publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 with: miniconda-version: "latest" python-version: 3.7 @@ -17,7 +19,7 @@ jobs: - name: Install dependencies shell: bash -l {0} run: | - conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch + 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 @@ -26,7 +28,6 @@ jobs: shell: bash -l {0} env: ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} - PYTORCH_CHANNEL: "pytorch" UPLOAD_USER: "pytorch" run: | chmod +x ./conda.recipe/build_and_upload.sh From ceb18dfc512d98139a388a639c22cf7054f66ae8 Mon Sep 17 00:00:00 2001 From: vfdev Date: Tue, 24 Nov 2020 18:19:35 +0100 Subject: [PATCH 5/8] Update binaries-release.yml --- .github/workflows/binaries-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/binaries-release.yml b/.github/workflows/binaries-release.yml index e38a12d6e3d..395ffdfe7ce 100644 --- a/.github/workflows/binaries-release.yml +++ b/.github/workflows/binaries-release.yml @@ -1,8 +1,10 @@ name: Stable Releases on: + push: + tags: ["v*"] release: - types: [created] + types: [published] jobs: build-publish: From baddfb65b2c7fca0ec6576c856207ba8f12bd7c6 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 3 Dec 2020 17:19:32 +0630 Subject: [PATCH 6/8] merge master --- .github/workflows/binaries-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/binaries-release.yml b/.github/workflows/binaries-release.yml index 395ffdfe7ce..b86eafb0a81 100644 --- a/.github/workflows/binaries-release.yml +++ b/.github/workflows/binaries-release.yml @@ -2,7 +2,7 @@ name: Stable Releases on: push: - tags: ["v*"] + tags: ["v*"] release: types: [published] From ab2623212df47300d2799f5c3c00b0173edb40d5 Mon Sep 17 00:00:00 2001 From: vfdev Date: Thu, 17 Dec 2020 23:09:53 +0100 Subject: [PATCH 7/8] Update binaries-release.yml --- .github/workflows/binaries-release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/binaries-release.yml b/.github/workflows/binaries-release.yml index b86eafb0a81..95a433adb1f 100644 --- a/.github/workflows/binaries-release.yml +++ b/.github/workflows/binaries-release.yml @@ -1,8 +1,6 @@ name: Stable Releases on: - push: - tags: ["v*"] release: types: [published] From 07713f7a80f80dfb1fea8a0142965df6a1ea973c Mon Sep 17 00:00:00 2001 From: vfdev Date: Thu, 17 Dec 2020 23:12:05 +0100 Subject: [PATCH 8/8] Update docs.yml --- .github/workflows/docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6191b77549a..66bbf7ca408 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,7 +3,6 @@ name: Build docs on: push: branches: [master] - tags: ["v*"] release: types: [published]