Skip to content

Commit

Permalink
Add standalone-cli build for Windows Arm64 platform (#10001)
Browse files Browse the repository at this point in the history
* Add standalone-cli build for Windows ARM64

* Fix path to binary on windows

* Fix style

* Simplify Windows mapping in standalone CLI tests

Co-authored-by: Jordan Pittman <[email protected]>
  • Loading branch information
MJRasicci and thecrypticace authored Dec 5, 2022
1 parent a92932f commit 9e8d37a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ jobs:
standalone-cli/dist/tailwindcss-macos-arm64
standalone-cli/dist/tailwindcss-macos-x64
standalone-cli/dist/tailwindcss-windows-x64.exe
standalone-cli/dist/tailwindcss-windows-arm64.exe
3 changes: 2 additions & 1 deletion standalone-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build": "pkg . --compress Brotli --no-bytecode --public-packages \"*\" --public",
"prebuild": "rimraf dist",
"postbuild": "move-file dist/tailwindcss-standalone-macos-x64 dist/tailwindcss-macos-x64 && move-file dist/tailwindcss-standalone-macos-arm64 dist/tailwindcss-macos-arm64 && move-file dist/tailwindcss-standalone-win-x64.exe dist/tailwindcss-windows-x64.exe && move-file dist/tailwindcss-standalone-linuxstatic-x64 dist/tailwindcss-linux-x64 && move-file dist/tailwindcss-standalone-linuxstatic-arm64 dist/tailwindcss-linux-arm64 && move-file dist/tailwindcss-standalone-linuxstatic-armv7 dist/tailwindcss-linux-armv7",
"postbuild": "move-file dist/tailwindcss-standalone-macos-x64 dist/tailwindcss-macos-x64 && move-file dist/tailwindcss-standalone-macos-arm64 dist/tailwindcss-macos-arm64 && move-file dist/tailwindcss-standalone-win-x64.exe dist/tailwindcss-windows-x64.exe && move-file dist/tailwindcss-standalone-win-arm64.exe dist/tailwindcss-windows-arm64.exe && move-file dist/tailwindcss-standalone-linuxstatic-x64 dist/tailwindcss-linux-x64 && move-file dist/tailwindcss-standalone-linuxstatic-arm64 dist/tailwindcss-linux-arm64 && move-file dist/tailwindcss-standalone-linuxstatic-armv7 dist/tailwindcss-linux-armv7",
"test": "jest"
},
"devDependencies": {
Expand All @@ -27,6 +27,7 @@
"node16-macos-x64",
"node16-macos-arm64",
"node16-win-x64",
"node16-win-arm64",
"node16-linuxstatic-x64",
"node16-linuxstatic-arm64",
"node16-linuxstatic-armv7"
Expand Down
10 changes: 4 additions & 6 deletions standalone-cli/tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ const os = require('os')
const fs = require('fs-extra')

const platformMap = {
darwin: 'macos',
win32: 'windows',
linux: 'linux',
darwin: `./dist/tailwindcss-macos-${process.arch}`,
linux: `./dist/tailwindcss-linux-${process.arch}`,
win32: `.\\dist\\tailwindcss-windows-${process.arch}`,
}

function exec(args) {
return execSync(
`./dist/tailwindcss-${platformMap[process.platform]}-${process.arch} ${args}`
).toString()
return execSync(`${platformMap[process.platform]} ${args}`).toString()
}

it('works', () => {
Expand Down

0 comments on commit 9e8d37a

Please sign in to comment.