Skip to content

Commit d381ad6

Browse files
committed
feat: fix workflow
1 parent 12c2b66 commit d381ad6

File tree

2 files changed

+43
-37
lines changed

2 files changed

+43
-37
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,14 @@ jobs:
4949
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5050
run: |
5151
set -euo pipefail
52-
53-
echo "Running semantic-release dry-run to extract next version..."
54-
VERSION=$(npx semantic-release --no-ci --dry-run 2>&1 | tee semantic-output.log | grep -oP 'The next release version is \K[0-9]+\.[0-9]+\.[0-9]+' || true)
55-
52+
VERSION=$(npx semantic-release --no-ci --dry-run --branch ${{ github.ref_name }} 2>&1 | tee semantic-output.log | grep -oP 'The next release version is \K[0-9]+\.[0-9]+\.[0-9]+(?:-[A-Za-z0-9.]+)?' || true)
5653
if [ -z "$VERSION" ]; then
5754
echo "Failed to extract VERSION from semantic-release output:"
5855
cat semantic-output.log
5956
exit 1
6057
fi
61-
6258
echo "Detected VERSION: $VERSION"
6359
echo "VERSION=$VERSION" >> $GITHUB_ENV
64-
- name: Log in to GHCR
65-
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u skunxicat --password-stdin
6660
- name: Build Docker images
6761
run: |
6862
echo "${{ secrets.GHCR_PAT }}" > github_token
@@ -72,7 +66,7 @@ jobs:
7266
docker buildx build --builder shell-runtime-builder --platform linux/arm64 \
7367
--build-arg VERSION="$VERSION" \
7468
--build-arg HTTP_CLI_VERSION="$HTTP_CLI_VERSION" \
75-
--output type=registry --progress=plain \
69+
--output type=docker --progress=plain \
7670
--secret id=github_token,src=github_token \
7771
--cache-from type=local,src=/tmp/.buildx-cache \
7872
--cache-to type=local,dest=/tmp/.buildx-cache \
@@ -83,36 +77,38 @@ jobs:
8377
docker buildx build --builder shell-runtime-builder --platform linux/arm64 \
8478
--build-arg VERSION="$VERSION" \
8579
--build-arg HTTP_CLI_VERSION="$HTTP_CLI_VERSION" \
86-
--output type=registry --progress=plain \
80+
--output type=docker --progress=plain \
8781
--secret id=github_token,src=github_token \
8882
--cache-from type=local,src=/tmp/.buildx-cache \
8983
--cache-to type=local,dest=/tmp/.buildx-cache \
9084
-t $IMAGE:tiny-$VERSION \
9185
-t $IMAGE:tiny-latest \
9286
--target tiny .
9387
94-
docker buildx build --builder shell-runtime-builder --platform linux/arm64 \
95-
--build-arg VERSION="$VERSION" \
96-
--build-arg HTTP_CLI_VERSION="$HTTP_CLI_VERSION" \
97-
--output type=registry --progress=plain \
98-
--secret id=github_token,src=github_token \
99-
--cache-from type=local,src=/tmp/.buildx-cache \
100-
--cache-to type=local,dest=/tmp/.buildx-cache \
101-
-t $IMAGE:micro-$VERSION \
102-
-t $IMAGE:micro-latest \
103-
--target micro .
88+
# docker buildx build --builder shell-runtime-builder --platform linux/arm64 \
89+
# --build-arg VERSION="$VERSION" \
90+
# --build-arg HTTP_CLI_VERSION="$HTTP_CLI_VERSION" \
91+
# --output type=docker --progress=plain \
92+
# --secret id=github_token,src=github_token \
93+
# --cache-from type=local,src=/tmp/.buildx-cache \
94+
# --cache-to type=local,dest=/tmp/.buildx-cache \
95+
# -t $IMAGE:micro-$VERSION \
96+
# -t $IMAGE:micro-latest \
97+
# --target micro .
10498
105-
docker buildx build --builder shell-runtime-builder --platform linux/arm64 \
106-
--build-arg VERSION="$VERSION" \
107-
--build-arg HTTP_CLI_VERSION="$HTTP_CLI_VERSION" \
108-
--output type=registry --progress=plain \
109-
--secret id=github_token,src=github_token \
110-
--cache-from type=local,src=/tmp/.buildx-cache \
111-
--cache-to type=local,dest=/tmp/.buildx-cache \
112-
-t $IMAGE:full-$VERSION \
113-
-t $IMAGE:full-latest \
99+
# docker buildx build --builder shell-runtime-builder --platform linux/arm64 \
100+
# --build-arg VERSION="$VERSION" \
101+
# --build-arg HTTP_CLI_VERSION="$HTTP_CLI_VERSION" \
102+
# --output type=docker --progress=plain \
103+
# --secret id=github_token,src=github_token \
104+
# --cache-from type=local,src=/tmp/.buildx-cache \
105+
# --cache-to type=local,dest=/tmp/.buildx-cache \
106+
# -t $IMAGE:full-$VERSION \
107+
# -t $IMAGE:full-latest \
114108
.
115109
shell: bash
110+
- name: Log in to GHCR
111+
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u skunxicat --password-stdin
116112
- run: npx semantic-release
117113
env:
118114
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

scripts/publish

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
#!/bin/sh
2-
set -e
2+
set -euo pipefail
33

4-
VERSION="$1"
4+
echo "Logging in to GitHub Container Registry..."
5+
echo "${GITHUB_TOKEN:?Environment variable GITHUB_TOKEN not set}" | docker login ghcr.io -u "${GITHUB_USER:-$(whoami)}" --password-stdin
6+
7+
# Get version argument
8+
VERSION="${1:-"dev"}"
9+
BASE_IMAGE="ghcr.io/ql4b/lambda-shell-runtime"
510

611
echo "Publishing Docker images with version $VERSION"
712

8-
for VARIANT in tiny micro full; do
9-
BASE_IMAGE="ghcr.io/ql4b/lambda-shell-runtime"
10-
TAG="$VERSION-$VARIANT"
11-
docker tag lambda-shell-runtime:$VARIANT "$BASE_IMAGE:$TAG"
12-
docker tag lambda-shell-runtime:$VARIANT "$BASE_IMAGE:$VARIANT-latest"
13-
docker push "$BASE_IMAGE:$TAG"
14-
docker push "$BASE_IMAGE:$VARIANT-latest"
13+
# for VARIANT in tiny micro full; do
14+
for VARIANT in tiny; do
15+
echo "Building and pushing $VARIANT image..."
16+
17+
TAG="$VERSION-$VARIANT"
18+
docker tag lambda-shell-runtime:$VARIANT "$BASE_IMAGE:$TAG"
19+
docker tag lambda-shell-runtime:$VARIANT "$BASE_IMAGE:$VARIANT-latest"
20+
docker tag lambda-shell-runtime:$VARIANT "$BASE_IMAGE:$VARIANT"
21+
docker push "$BASE_IMAGE:$TAG"
22+
docker push "$BASE_IMAGE:$VARIANT-latest"
23+
docker push "$BASE_IMAGE:$VARIANT"
24+
1525
done

0 commit comments

Comments
 (0)