|
55 | 55 | conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torchvision;print(torchvision.io.read_image('${PWD}/gallery/assets/dog1.jpg').shape)"
|
56 | 56 | conda env remove -p ${ENV_NAME}
|
57 | 57 | - name: Upload wheel to GitHub
|
58 |
| - if: ${{ github.event_name == 'push' && steps.extract_branch.outputs.branch == 'nightly' }} |
59 | 58 | uses: actions/upload-artifact@v3
|
60 | 59 | with:
|
61 | 60 | name: torchvision-py${{ matrix.py_vers }}-macos11-m1
|
|
71 | 70 | for pkg in dist/*; do
|
72 | 71 | aws s3 cp "$pkg" "s3://pytorch/whl/${CHANNEL}/cpu/" --acl public-read
|
73 | 72 | done
|
| 73 | + build_conda: |
| 74 | + name: "Build TorchVision M1 conda packages" |
| 75 | + runs-on: macos-m1 |
| 76 | + strategy: |
| 77 | + matrix: |
| 78 | + py_vers: [ "3.8", "3.9", "3.10" ] |
| 79 | + steps: |
| 80 | + - name: Checkout repository |
| 81 | + uses: actions/checkout@v2 |
| 82 | + |
| 83 | + - name: Install conda-build and purge previous artifacts |
| 84 | + shell: arch -arch arm64 bash {0} |
| 85 | + run: | |
| 86 | + . ~/miniconda3/etc/profile.d/conda.sh |
| 87 | + conda install -yq conda-build |
| 88 | + conda build purge-all |
| 89 | +
|
| 90 | + - name: Build TorchVision M1 conda package |
| 91 | + shell: arch -arch arm64 bash {0} |
| 92 | + env: |
| 93 | + ENV_NAME: conda-env-${{ github.run_id }} |
| 94 | + PYTHON_VERSION: ${{ matrix.py_vers }} |
| 95 | + CU_VERSION: cpu |
| 96 | + run: | |
| 97 | + . ~/miniconda3/etc/profile.d/conda.sh |
| 98 | + set -ex |
| 99 | + . packaging/pkg_helpers.bash |
| 100 | + setup_build_version |
| 101 | + setup_conda_pytorch_constraint |
| 102 | + export SOURCE_ROOT_DIR=$(pwd) |
| 103 | + conda build -c defaults $CONDA_CHANNEL_FLAGS --no-anaconda-upload --python "$PYTHON_VERSION" packaging/torchvision |
| 104 | + mkdir -p dist |
| 105 | + cp ~/miniconda3/conda-bld/osx-arm64/*.tar.bz2 dist/ |
| 106 | + - name: Upload package to GitHub |
| 107 | + uses: actions/upload-artifact@v3 |
| 108 | + with: |
| 109 | + name: torchvision-py${{ matrix.py_vers }}-macos11-m1-conda |
| 110 | + path: dist/ |
| 111 | + - name: Upload package to conda |
| 112 | + if: ${{ github.event_name == 'push' && steps.extract_branch.outputs.branch == 'nightly' }} |
| 113 | + shell: arch -arch arm64 bash {0} |
| 114 | + env: |
| 115 | + CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }} |
| 116 | + UPLOAD_CHANNEL: nightly |
| 117 | + run: | |
| 118 | + . ~/miniconda3/etc/profile.d/conda.sh |
| 119 | + conda install -yq anaconda-client |
| 120 | + set -x |
| 121 | + anaconda -t "${CONDA_PYTORCHBOT_TOKEN}" upload ~/miniconda3/conda-bld/osx-arm64/*.tar.bz2 -u "pytorch-${UPLOAD_CHANNEL}" --label main --no-progress --force |
0 commit comments