6
6
push :
7
7
branches :
8
8
- nightly
9
+ tags :
10
+ # NOTE: Binary build pipelines should only get triggered on release candidate builds
11
+ # Release candidate tags look like: v1.11.0-rc1
12
+ - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
9
13
workflow_dispatch :
14
+ env :
15
+ CHANNEL : " nightly"
10
16
jobs :
11
17
build_wheels :
12
18
name : " Build TorchAudio M1 wheels"
17
23
steps :
18
24
- name : Checkout repository
19
25
uses : actions/checkout@v2
26
+ - name : Set CHANNEL (only for tagged pushes)
27
+ if : ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }}
28
+ run : |
29
+ # reference ends with an RC suffix
30
+ if [[ ${GITHUB_REF_NAME} = *-rc[0-9]* ]]; then
31
+ echo "CHANNEL=test" >> "$GITHUB_ENV"
32
+ fi
20
33
- name : Build TorchAudio M1 wheel
21
34
shell : arch -arch arm64 bash {0}
22
35
env :
@@ -27,10 +40,15 @@ jobs:
27
40
. ~/miniconda3/etc/profile.d/conda.sh
28
41
set -ex
29
42
. packaging/pkg_helpers.bash
30
- setup_build_version
43
+ # if we are uploading to test channell, our version consist only of the base: 0.x.x - no date string or suffix added
44
+ if [[ $CHANNEL == "test" ]]; then
45
+ setup_base_build_version
46
+ else
47
+ setup_build_version
48
+ fi
31
49
WHL_NAME=torchaudio-${BUILD_VERSION}-cp${PY_VERS/.}-cp${PY_VERS/.}-macosx_11_0_arm64.whl
32
50
conda create -yp ${ENV_NAME} python=${PY_VERS} numpy cmake ninja wheel pkg-config
33
- conda run -p ${ENV_NAME} python3 -mpip install torch --pre --extra-index-url=https://download.pytorch.org/whl/nightly
51
+ conda run -p ${ENV_NAME} python3 -mpip install torch --pre --extra-index-url=https://download.pytorch.org/whl/${CHANNEL}
34
52
conda run -p ${ENV_NAME} python3 -mpip install delocate
35
53
conda run -p ${ENV_NAME} python3 setup.py bdist_wheel
36
54
export PYTORCH_VERSION="$(conda run -p ${ENV_NAME} python3 -mpip show torch | grep ^Version: | sed 's/Version: *//')"
@@ -45,25 +63,24 @@ jobs:
45
63
. ~/miniconda3/etc/profile.d/conda.sh
46
64
set -ex
47
65
conda create -yp ${ENV_NAME} python=${PY_VERS} numpy
48
- conda run -p ${ENV_NAME} python3 -mpip install torch --pre --extra-index-url=https://download.pytorch.org/whl/nightly
66
+ conda run -p ${ENV_NAME} python3 -mpip install torch --pre --extra-index-url=https://download.pytorch.org/whl/${CHANNEL}
49
67
conda run -p ${ENV_NAME} python3 -mpip install dist/*.whl
50
68
# Test torch is importable, by changing cwd and running import commands
51
69
conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torchaudio;print('torchaudio version is ', torchaudio.__version__)"
52
70
conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torch;import torchaudio;torchaudio.set_audio_backend('sox_io')"
53
71
conda env remove -p ${ENV_NAME}
54
72
- name : Upload wheel to GitHub
55
- if : ${{ github.event_name == 'push' && steps.extract_branch.outputs.branch == 'nightly' }}
73
+ if : ${{ github.event_name == 'push' && (github.event.ref == 'ref/heads/ nightly' || startsWith(github.event.ref, 'refs/tags/')) }}
56
74
uses : actions/upload-artifact@v3
57
75
with :
58
76
name : torchaudio-py${{ matrix.py_vers }}-macos11-m1
59
77
path : dist/
60
78
- name : Upload wheel to S3
61
- if : ${{ github.event_name == 'push' && steps.extract_branch.outputs.branch == 'nightly' }}
79
+ if : ${{ github.event_name == 'push' && (github.event.ref == 'ref/heads/ nightly' || startsWith(github.event.ref, 'refs/tags/')) }}
62
80
shell : arch -arch arm64 bash {0}
63
81
env :
64
82
AWS_ACCESS_KEY_ID : ${{ secrets.AWS_PYTORCH_UPLOADER_ACCESS_KEY_ID }}
65
83
AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_PYTORCH_UPLOADER_SECRET_ACCESS_KEY }}
66
- CHANNEL : nightly
67
84
run : |
68
85
for pkg in dist/*; do
69
86
aws s3 cp "$pkg" "s3://pytorch/whl/${CHANNEL}/cpu/" --acl public-read
0 commit comments