diff --git a/Package.swift b/Package.swift index 09bd9c9..0297c30 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-1e1d57de8a8984c528a106f038fb432b3965b1873c8603ee6bd661f935a77f4a/tailwindcss.artifactbundleindex", - checksum: "1e1d57de8a8984c528a106f038fb432b3965b1873c8603ee6bd661f935a77f4a" + "https://github.com/laosb/SwiftTailwind/releases/download/1.1.0-test.4+tw.4.1.14/tailwindcss.artifactbundleindex", + checksum: "ec4df49e361db5fc3159c431e5661af2e1b22d8575c64ce0482a8e84cfd93d04" ), .target( name: "SwiftTailwindExample", diff --git a/README.md b/README.md index 362048c..81577ca 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # 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. ## Usage @@ -11,7 +8,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.1.1+tw.4.1.18"), + .package(url: "https://github.com/laosb/SwiftTailwind.git", from: "1.0.0+tw.4.1.12"), ], ``` @@ -52,7 +49,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 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. +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. Any contributions to automate the artifact generation are welcome! diff --git a/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift b/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift index 26fb71f..60423b5 100644 --- a/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift +++ b/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder+File Operations.swift @@ -22,12 +22,14 @@ 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, "."] - process.currentDirectoryURL = bundleDirURL + process.arguments = ["-r", zipPathURL.path, bundleName] + process.currentDirectoryURL = workDirURL try process.run() process.waitUntilExit() diff --git a/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder.swift b/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder.swift index cf7fb01..eef4027 100644 --- a/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder.swift +++ b/Sources/TailwindCSSCLIArtifactBundler/ArtifactBundleBuilder.swift @@ -10,8 +10,6 @@ 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) {