Skip to content

Commit 1289e9d

Browse files
authored
Add tags to manywheel; fix typo (#773)
* Add tags to manywheel; fix typo * set local default values
1 parent 6778826 commit 1289e9d

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/workflows/build-manywheel-images.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Authenticate if WITH_PUSH
3939
run: |
4040
if [[ "${WITH_PUSH}" == true ]]; then
41-
echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password--stdin
41+
echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin
4242
fi
4343
- name: Build Docker Image
4444
run: |
@@ -57,7 +57,7 @@ jobs:
5757
- name: Authenticate if WITH_PUSH
5858
run: |
5959
if [[ "${WITH_PUSH}" == true ]]; then
60-
echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password--stdin
60+
echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin
6161
fi
6262
- name: Build Docker Image
6363
run: |
@@ -70,7 +70,7 @@ jobs:
7070
- name: Authenticate if WITH_PUSH
7171
run: |
7272
if [[ "${WITH_PUSH}" == true ]]; then
73-
echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password--stdin
73+
echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin
7474
fi
7575
- name: Build Docker Image
7676
run: |

manywheel/build_docker.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,30 @@ DOCKER_IMAGE=${DOCKER_REGISTRY}/pytorch/manylinux-builder:${DOCKER_TAG}
5252
"${TOPDIR}"
5353
)
5454

55+
GITHUB_REF=${GITHUB_REF:-$(git symbolic-ref -q HEAD || git describe --tags --exact-match)}
56+
GIT_BRANCH_NAME=${GITHUB_REF##*/}
57+
GIT_COMMIT_SHA=${GITHUB_SHA:-$(git rev-parse HEAD)}
58+
DOCKER_IMAGE_BRANCH_TAG=${DOCKER_IMAGE}-${GIT_BRANCH_NAME}
59+
DOCKER_IMAGE_SHA_TAG=${DOCKER_IMAGE}-${GIT_COMMIT_SHA}
60+
5561
(
5662
set -x
5763
docker tag ${DOCKER_IMAGE} ${LEGACY_DOCKER_IMAGE}
64+
if [[ -n ${GITHUB_REF} ]]; then
65+
docker tag ${DOCKER_IMAGE} ${DOCKER_IMAGE_BRANCH_TAG}
66+
docker tag ${DOCKER_IMAGE} ${DOCKER_IMAGE_SHA_TAG}
67+
fi
5868
)
5969

6070
if [[ "${WITH_PUSH}" == true ]]; then
6171
(
6272
set -x
6373
docker push "${DOCKER_IMAGE}"
6474
docker push "${LEGACY_DOCKER_IMAGE}"
75+
if [[ -n ${GITHUB_REF} ]]; then
76+
docker push "${DOCKER_IMAGE_BRANCH_TAG}"
77+
docker push "${DOCKER_IMAGE_SHA_TAG}"
78+
fi
6579
)
6680
fi
6781

0 commit comments

Comments
 (0)