Skip to content

Commit df4afcf

Browse files
committed
ci: add docker build and push back to publish-release.yml
1 parent fbb4a9d commit df4afcf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/publish-release.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66

77
env:
88
IMAGE_BASE_NAME: docker.pkg.github.com/${{ github.repository }}
9-
IMAGE_NAME: ${IMAGE_BASE_NAME}/${IMAGE_NAME}
109

1110
jobs:
1211
publish-release:
@@ -48,13 +47,14 @@ jobs:
4847

4948
# The GITHUB_REF tag comes in the format 'refs/tags/xxx'.
5049
# So if we split on '/' and take the 3rd value, we can get the release name.
51-
52-
# ./gradlew jibDockerBuild --image="${IMAGE_NAME}:${NEW_VERSION}"
53-
# echo "$GITHUB_TOKEN" | docker login --username "$GITHUB_REPOSITORY" --password-stdin https://docker.pkg.github.com
54-
# docker push "${IMAGE_NAME}:${NEW_VERSION}"
5550
run: |
5651
export GPG_TTY=$(tty) && echo ${GPG_KEY_BASE64} | base64 --decode | gpg --fast-import --batch
5752
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
58-
echo "New version: ${NEW_VERSION}"
53+
REPO_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
54+
IMAGE=${IMAGE_BASE_NAME}/${REPO_NAME}:${NEW_VERSION}
55+
echo "Releasing new version ${NEW_VERSION} of ${REPO_NAME} and docker image $IMAGE"
5956
./gradlew -Pversion=${NEW_VERSION} publish closeAndReleaseRepository -Dorg.gradle.internal.publish.checksums.insecure=true --info
57+
./gradlew jibDockerBuild --image="${IMAGE}"
58+
echo "$GITHUB_TOKEN" | docker login --username "$GITHUB_REPOSITORY" --password-stdin https://docker.pkg.github.com
59+
docker push "${IMAGE}"
6060

0 commit comments

Comments
 (0)