From f9024a8cd73943c64bf309e34b7ffbcd04968908 Mon Sep 17 00:00:00 2001 From: laosb Date: Tue, 20 Jan 2026 23:15:34 +0800 Subject: [PATCH 1/7] fix: Add checksum to release tag and fix zip invocation Fix zip creation so the bundle is archived with the bundle root rather than its full path. Use a standardized zip path, set Process.currentDirectoryURL to the bundle's parent, and pass the bundle basename to /usr/bin/zip. --- .github/workflows/release-tailwindcss-cli.yml | 12 +++--------- .../ArtifactBundleBuilder+File Operations.swift | 8 +++++++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-tailwindcss-cli.yml b/.github/workflows/release-tailwindcss-cli.yml index f273eb3..7ab7dc2 100644 --- a/.github/workflows/release-tailwindcss-cli.yml +++ b/.github/workflows/release-tailwindcss-cli.yml @@ -70,7 +70,7 @@ jobs: - name: Create release uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1 with: - tag_name: TailwindCSSCLI-${{ inputs.tailwind_version }} + tag_name: TailwindCSSCLI-${{ inputs.tailwind_version }}-${{ steps.checksum.outputs.checksum }} name: TailwindCSS CLI ${{ inputs.tailwind_version }} body: | ## TailwindCSS CLI Artifact Bundles @@ -82,20 +82,14 @@ jobs: - macOS x64 (`x86_64-apple-darwin`) - macOS ARM64 (`aarch64-apple-darwin`) - ### Usage - Add the artifact bundle to your `Package.swift`: + ### Binary Target Definition ```swift .binaryTarget( name: "TailwindCSSCLI", - url: "https://github.com/${{ github.repository }}/releases/download/TailwindCSSCLI@${{ inputs.tailwind_version }}/tailwindcss.artifactbundleindex", + url: "https://github.com/${{ github.repository }}/releases/download/TailwindCSSCLI-${{ inputs.tailwind_version }}-${{ steps.checksum.outputs.checksum }}/tailwindcss.artifactbundleindex", checksum: "${{ steps.checksum.outputs.checksum }}" ) ``` - - ### Checksum - ``` - ${{ steps.checksum.outputs.checksum }} - ``` draft: false prerelease: false make_latest: false diff --git a/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift b/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift index 51bae14..60423b5 100644 --- a/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift +++ b/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift @@ -21,9 +21,15 @@ extension ArtifactBundleBuilder { try fileManager.removeItem(atPath: zipPath) } + let bundleDirURL = URL(fileURLWithPath: bundleDir) + let workDirURL = bundleDirURL.deletingLastPathComponent() + let bundleName = bundleDirURL.lastPathComponent + let process = Process() process.executableURL = URL(fileURLWithPath: "/usr/bin/zip") - process.arguments = ["-r", zipPath, bundleDir] + let zipPathURL = URL(fileURLWithPath: zipPath).standardizedFileURL + process.arguments = ["-r", zipPathURL.path, bundleName] + process.currentDirectoryURL = workDirURL try process.run() process.waitUntilExit() From 8032cfa0b2f4070e407f3000959b4b506ac972a0 Mon Sep 17 00:00:00 2001 From: laosb Date: Tue, 20 Jan 2026 23:51:23 +0800 Subject: [PATCH 2/7] fix: Zip bundle directory instead of parent dir --- .../ArtifactBundleBuilder+File Operations.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift b/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift index 60423b5..26fb71f 100644 --- a/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift +++ b/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift @@ -22,14 +22,12 @@ extension ArtifactBundleBuilder { } let bundleDirURL = URL(fileURLWithPath: bundleDir) - let workDirURL = bundleDirURL.deletingLastPathComponent() - let bundleName = bundleDirURL.lastPathComponent let process = Process() process.executableURL = URL(fileURLWithPath: "/usr/bin/zip") let zipPathURL = URL(fileURLWithPath: zipPath).standardizedFileURL - process.arguments = ["-r", zipPathURL.path, bundleName] - process.currentDirectoryURL = workDirURL + process.arguments = ["-r", zipPathURL.path, "."] + process.currentDirectoryURL = bundleDirURL try process.run() process.waitUntilExit() From c9cbf7f13307eb2b8864194a574f2c0537a32332 Mon Sep 17 00:00:00 2001 From: laosb Date: Wed, 21 Jan 2026 09:07:10 +0800 Subject: [PATCH 3/7] chore: Update TailwindCSSCLI to v4.1.18 --- Package.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 0297c30..5c55759 100644 --- a/Package.swift +++ b/Package.swift @@ -25,8 +25,8 @@ let package = Package( .binaryTarget( name: "TailwindCSSCLI", url: - "https://github.com/laosb/SwiftTailwind/releases/download/1.1.0-test.4+tw.4.1.14/tailwindcss.artifactbundleindex", - checksum: "ec4df49e361db5fc3159c431e5661af2e1b22d8575c64ce0482a8e84cfd93d04" + "https://github.com/laosb/SwiftTailwind/releases/download/TailwindCSSCLI-v4.1.18-e41dde7884391c83e50815a25dc0db70061b2dfdc9ed9026e31689594a2305af/tailwindcss.artifactbundleindex", + checksum: "e41dde7884391c83e50815a25dc0db70061b2dfdc9ed9026e31689594a2305af" ), .target( name: "SwiftTailwindExample", From 6211adec8e7775f19c84649baa2f10d67e4b90eb Mon Sep 17 00:00:00 2001 From: laosb Date: Wed, 21 Jan 2026 13:51:36 +0800 Subject: [PATCH 4/7] fix: Add macOS arm64 'arm64-apple-macosx' triple Support new Apple Silicon triple used by the Swift 6.3 toolchain. --- .../TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder.swift b/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder.swift index eef4027..cf7fb01 100644 --- a/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder.swift +++ b/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder.swift @@ -10,6 +10,8 @@ class ArtifactBundleBuilder { BinaryConfiguration(binaryName: "tailwindcss-linux-x64", triple: "x86_64-unknown-linux-gnu"), BinaryConfiguration(binaryName: "tailwindcss-macos-x64", triple: "x86_64-apple-darwin"), BinaryConfiguration(binaryName: "tailwindcss-macos-arm64", triple: "aarch64-apple-darwin"), + // Since Swift 6.3 toolchain, the Apple Silicon triple changed from aarch64 to arm64. + BinaryConfiguration(binaryName: "tailwindcss-macos-arm64", triple: "arm64-apple-macosx"), ] init(version: String, workDir: String, outputDir: String) { From df3d60940b99e2ec16e4c2e9f5503000163f6ba8 Mon Sep 17 00:00:00 2001 From: laosb Date: Wed, 21 Jan 2026 13:56:26 +0800 Subject: [PATCH 5/7] chore: Update TailwindCSSCLI binary URL and checksum --- Package.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 5c55759..09bd9c9 100644 --- a/Package.swift +++ b/Package.swift @@ -25,8 +25,8 @@ let package = Package( .binaryTarget( name: "TailwindCSSCLI", url: - "https://github.com/laosb/SwiftTailwind/releases/download/TailwindCSSCLI-v4.1.18-e41dde7884391c83e50815a25dc0db70061b2dfdc9ed9026e31689594a2305af/tailwindcss.artifactbundleindex", - checksum: "e41dde7884391c83e50815a25dc0db70061b2dfdc9ed9026e31689594a2305af" + "https://github.com/laosb/SwiftTailwind/releases/download/TailwindCSSCLI-v4.1.18-1e1d57de8a8984c528a106f038fb432b3965b1873c8603ee6bd661f935a77f4a/tailwindcss.artifactbundleindex", + checksum: "1e1d57de8a8984c528a106f038fb432b3965b1873c8603ee6bd661f935a77f4a" ), .target( name: "SwiftTailwindExample", From ddf4b9df810f7b2947b4805dc14020bb585034dc Mon Sep 17 00:00:00 2001 From: laosb Date: Sun, 8 Feb 2026 20:40:58 +0800 Subject: [PATCH 6/7] docs: Update README with badges and version info Update the package dependency version from 1.0.0+tw.4.1.12 to 1.1.1+tw.4.1.18 and add Swift Package Index badges. Clarify that the artifact bundle is now built using a custom Swift CLI tool with GitHub Actions automation instead of a shell script. --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 81577ca..654219c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # SwiftTailwind +[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Flaosb%2FSwiftTailwind%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/laosb/SwiftTailwind) +[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Flaosb%2FSwiftTailwind%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/laosb/SwiftTailwind) + Use Tailwind CSS in your Swift projects, seemlessly integrated as a Build Tool Plugin. ## Usage @@ -8,7 +11,7 @@ Add this package to your Swift project as a dependency using the Swift Package M ```swift dependencies: [ - .package(url: "https://github.com/laosb/SwiftTailwind.git", from: "1.0.0+tw.4.1.12"), + .package(url: "https://github.com/laosb/SwiftTailwind.git", from: "1.1.1+tw.4.1.18"), ], ``` @@ -49,7 +52,7 @@ let cssFileURL = Bundle.module A binary artifact bundle will be downloaded from this repo's GitHub Releases. It contains the standalone version of Tailwind CSS CLI, which is used to process your Tailwind CSS files. This allows you to use Tailwind CSS without needing to install Node.js or npm in your Swift project. -It is built using [`Scripts/buildArtifactBundle.sh`](Scripts/buildArtifactBundle.sh), which pulls the specified version of Tailwind CSS CLI from their GitHub Releases and packages it into a Swift Package compatible format. It is then manually uploaded to this repository's GitHub Releases. +It is built using a custom Swift CLI at [`Sources/TailwindCSSCLIArtifactBundler`](Sources/TailwindCSSCLIArtifactBundler), which pulls the specified version of Tailwind CSS CLI from their GitHub Releases and packages it into a Swift Package compatible format. When a new Tailwind CSS version is release upstream, a GitHub Actions [workflow](.github/workflows/release-tailwindcss-cli.yml) is usually triggered manually with the new version number to create a new Tailwind CSS CLI release in this repo. After that, the [`Package.swift`](Package.swift) file should be updated to point to the new CLI version, and a new SwiftTailwind release should be created. Any contributions to automate the artifact generation are welcome! From 0006f2854e3277757a68cf41590b73dee9dcdf26 Mon Sep 17 00:00:00 2001 From: laosb Date: Sun, 8 Feb 2026 20:43:44 +0800 Subject: [PATCH 7/7] docs: Fix badge type parameter in README The second badge was incorrectly using `type=swift-versions` instead of `type=platforms`. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 654219c..362048c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # SwiftTailwind [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Flaosb%2FSwiftTailwind%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/laosb/SwiftTailwind) -[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Flaosb%2FSwiftTailwind%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/laosb/SwiftTailwind) +[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Flaosb%2FSwiftTailwind%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/laosb/SwiftTailwind) Use Tailwind CSS in your Swift projects, seemlessly integrated as a Build Tool Plugin.