Skip to content

Commit 47e8556

Browse files
Add standalone tailwindcss CLI (tailwindlabs#6506)
* Move standalone CLI into main repo * Update release tag * Update workflow * Ignore standalone CLI tests * Fix style * Update changelog [ci skip]
1 parent 0ddbb36 commit 47e8556

File tree

13 files changed

+10981
-2
lines changed

13 files changed

+10981
-2
lines changed

.github/workflows/build-cli.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build Standalone CLI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
CI: true
10+
11+
jobs:
12+
build_cli:
13+
runs-on: macos-11
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- run: git fetch --tags
18+
19+
- name: Resolve version
20+
id: vars
21+
run: echo "::set-output name=tag_name::$(git describe --tags --abbrev=0)"
22+
23+
- name: Use Node.js 16
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: '16'
27+
registry-url: 'https://registry.npmjs.org'
28+
29+
- name: Build tailwindcss
30+
run: npm run prepublishOnly
31+
32+
- name: Install standalone cli dependencies
33+
run: npm install
34+
working-directory: standalone-cli
35+
36+
- name: Build standalone cli
37+
run: npm run build
38+
working-directory: standalone-cli
39+
40+
- name: Test
41+
run: npm test
42+
working-directory: standalone-cli
43+
44+
- name: Release
45+
uses: softprops/action-gh-release@v1
46+
with:
47+
draft: true
48+
tag_name: ${{ steps.vars.outputs.tag_name }}
49+
body: |
50+
* [Linux (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ steps.vars.outputs.tag_name }}/tailwindcss-linux-x64)
51+
* [macOS (arm64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ steps.vars.outputs.tag_name }}/tailwindcss-macos-arm64)
52+
* [macOS (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ steps.vars.outputs.tag_name }}/tailwindcss-macos-x64)
53+
* [Windows (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ steps.vars.outputs.tag_name }}/tailwindcss-windows-x64.exe)
54+
files: |
55+
dist/tailwindcss-linux-x64
56+
dist/tailwindcss-macos-arm64
57+
dist/tailwindcss-macos-x64
58+
dist/tailwindcss-windows-x64.exe

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
CI: true
4343

4444
- name: Publish
45-
run: npm publish --tag next
45+
run: npm publish
4646
env:
4747
CI: true
4848
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- Warn about invalid globs in `content` ([#6449](https://github.com/tailwindlabs/tailwindcss/pull/6449))
13+
- Add standalone tailwindcss CLI ([#6506](https://github.com/tailwindlabs/tailwindcss/pull/6506))
1314

1415
### Fixed
1516

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@
101101
],
102102
"testPathIgnorePatterns": [
103103
"/node_modules/",
104-
"/integrations/"
104+
"/integrations/",
105+
"/standalone-cli/"
105106
],
106107
"transform": {
107108
"\\.js$": "@swc/jest"

standalone-cli/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
/dist

standalone-cli/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Tailwind Standalone CLI
2+
3+
> Standalone version of [Tailwind CLI](https://tailwindcss.com/docs/installation#using-tailwind-cli)
4+
5+
## Installation
6+
7+
Download the appropriate platform-specific version of the `tailwindcss` cli from the [latest release](https://github.com/tailwindlabs/tailwindcss/releases).
8+
9+
## Usage
10+
11+
```
12+
./tailwindcss-macos -o tailwind.css
13+
```
14+
15+
Check out the [Tailwind CLI documentation](https://tailwindcss.com/docs/installation#using-tailwind-cli) for details on the available options.

0 commit comments

Comments
 (0)