From 9be0695c553a74929814fb48a3445d9a6712b5b9 Mon Sep 17 00:00:00 2001 From: laosb Date: Tue, 20 Jan 2026 22:25:18 +0800 Subject: [PATCH 1/3] fix: zip path finding --- .../ArtifactBundleBuilder+File Operations.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift b/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift index ac45cd4..51bae14 100644 --- a/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift +++ b/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift @@ -21,12 +21,9 @@ extension ArtifactBundleBuilder { try fileManager.removeItem(atPath: zipPath) } - let bundleDirURL = URL(fileURLWithPath: bundleDir) - let bundleName = bundleDirURL.lastPathComponent - let process = Process() process.executableURL = URL(fileURLWithPath: "/usr/bin/zip") - process.arguments = ["-r", zipPath, bundleName] + process.arguments = ["-r", zipPath, bundleDir] try process.run() process.waitUntilExit() From f9024a8cd73943c64bf309e34b7ffbcd04968908 Mon Sep 17 00:00:00 2001 From: laosb Date: Tue, 20 Jan 2026 23:15:34 +0800 Subject: [PATCH 2/3] 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 3/3] 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()