release-me-sh 0.8.4 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/docker.sh +33 -2
package/package.json
CHANGED
package/plugins/docker.sh
CHANGED
|
@@ -1,9 +1,33 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
set -eu
|
|
3
3
|
|
|
4
|
+
# Docker buildx script was copied from
|
|
5
|
+
# https://docs.docker.com/build/cloud/ci
|
|
6
|
+
# and modified by @dalisoft for AMD64/ARM64 platforms
|
|
7
|
+
BUILDX_URL=
|
|
8
|
+
ARCH=$(uname -m | sed 's/aarch64/arm64/' | sed 's/x86_64/amd64/')
|
|
9
|
+
|
|
10
|
+
prepare() {
|
|
11
|
+
BUILDX_URL=$(curl -s https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-lab-releases.json | jq -r ".latest.assets[] | select(endswith(\"linux-${ARCH}\"))")
|
|
12
|
+
|
|
13
|
+
# Download docker buildx with Hyrdobuild support
|
|
14
|
+
mkdir -vp ~/.docker/cli-plugins/
|
|
15
|
+
curl --silent -L --output ~/.docker/cli-plugins/docker-buildx "${BUILDX_URL}"
|
|
16
|
+
chmod a+x ~/.docker/cli-plugins/docker-buildx
|
|
17
|
+
|
|
18
|
+
echo "${DOCKER_HUB_PAT-}" | docker login --username "${DOCKER_HUB_USERNAME-}" --password-stdin
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
cleanup() {
|
|
22
|
+
rm -rf ~/.docker/cli-plugins/
|
|
23
|
+
|
|
24
|
+
docker logout
|
|
25
|
+
}
|
|
26
|
+
|
|
4
27
|
release() {
|
|
5
28
|
# Build and publish a `Docker` tag
|
|
6
|
-
if [ -n "${DOCKER_HUB_PAT-}" ]; then
|
|
29
|
+
if [ -n "${DOCKER_HUB_USERNAME-}" ] && [ -n "${DOCKER_HUB_PAT-}" ]; then
|
|
30
|
+
|
|
7
31
|
log "Building and publishing Docker image..."
|
|
8
32
|
log_verbose "Docker tag: $NEXT_RELEASE_TAG and version: $NEXT_RELEASE_VERSION!"
|
|
9
33
|
|
|
@@ -16,14 +40,21 @@ release() {
|
|
|
16
40
|
return 1
|
|
17
41
|
fi
|
|
18
42
|
|
|
19
|
-
|
|
43
|
+
prepare
|
|
44
|
+
|
|
45
|
+
docker buildx use "${DOCKER_BUILDX_NAME-}"
|
|
46
|
+
docker buildx inspect --bootstrap
|
|
47
|
+
docker buildx build --platform=linux/amd64,linux/arm64 -t "$GIT_REPO_NAME:$NEXT_BUILD_VERSION" . --push
|
|
20
48
|
docker tag "$GIT_REPO_NAME:$NEXT_BUILD_VERSION" "$GIT_REPO_NAME:latest"
|
|
21
49
|
docker push "$GIT_REPO_NAME"
|
|
22
50
|
|
|
23
51
|
log "Docker image published [$NEXT_RELEASE_TAG]!"
|
|
52
|
+
|
|
53
|
+
cleanup
|
|
24
54
|
else
|
|
25
55
|
log "Skipped Docker image [$NEXT_RELEASE_TAG] in DRY-RUN mode."
|
|
26
56
|
fi
|
|
57
|
+
|
|
27
58
|
else
|
|
28
59
|
echo "
|
|
29
60
|
Docker Personal Access Token is not found
|