Skip to content

Commit 6603d1a

Browse files
committed
Strip Leading "v" From Version Strings
- Update Dockerfile to remove leading "v" from URL - Modify auto-release.yml to strip "v" from version - Adjust Justfile to build without "v" prefix
1 parent f01f3b3 commit 6603d1a

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/auto-release.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ jobs:
3232
with:
3333
repository: tailwindlabs/tailwindcss
3434

35+
- id: strip-v
36+
name: Strip leading “v” from version
37+
run: |
38+
# grab the raw output (e.g. "v4.1.7")
39+
vtag="${{ steps.get-latest-release.outputs.release }}"
40+
# remove one leading “v”
41+
clean_vtag="${vtag#v}"
42+
# expose it as an output
43+
echo "version_no_v=${clean_vtag}" >> $GITHUB_OUTPUT
44+
3545
- name: Build and push Docker image
3646
uses: docker/build-push-action@v4
3747
with:
@@ -40,6 +50,6 @@ jobs:
4050
push: true
4151
tags: |
4252
ghcr.io/scriptogre/tailwindcss:latest
43-
ghcr.io/scriptogre/tailwindcss:${{ steps.get-latest-release.outputs.release }}
53+
ghcr.io/scriptogre/tailwindcss:${{ steps.strip-v.outputs.version_no_v }}
4454
build-args: |
45-
TAILWINDCSS_VERSION=${{ steps.get-latest-release.outputs.release }}
55+
TAILWINDCSS_VERSION=${{ steps.strip-v.outputs.version_no_v }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN set -eux; \
1212
ARCH="${platform#*/}"; \
1313
[ "$ARCH" = "amd64" ] && ARCH=x64; \
1414
[ "$ARCH" = "aarch64" ] && ARCH=arm64; \
15-
url="https://github.com/tailwindlabs/tailwindcss/releases/download/${TAILWINDCSS_VERSION}/tailwindcss-${OS}-${ARCH}${TARGETVARIANT}"; \
15+
url="https://github.com/tailwindlabs/tailwindcss/releases/download/v${TAILWINDCSS_VERSION#v}/tailwindcss-${OS}-${ARCH}${TARGETVARIANT}"; \
1616
curl -fSL -o /tmp/tailwindcss "$url"; \
1717
chmod +x /tmp/tailwindcss
1818

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
rebuild release_version:
22
docker build \
3-
--build-arg TAILWINDCSS_VERSION=v{{release_version}} \
3+
--build-arg TAILWINDCSS_VERSION={{release_version}} \
44
-t ghcr.io/scriptogre/tailwindcss:{{release_version}} \
55
-t ghcr.io/scriptogre/tailwindcss:latest \
66
.

0 commit comments

Comments
 (0)