Skip to content

Commit

Permalink
Add standalone tailwindcss CLI (#6506)
Browse files Browse the repository at this point in the history
* Move standalone CLI into main repo

* Update release tag

* Update workflow

* Ignore standalone CLI tests

* Fix style

* Update changelog [ci skip]
  • Loading branch information
thecrypticace committed Dec 14, 2021
1 parent 0ddbb36 commit 47e8556
Show file tree
Hide file tree
Showing 13 changed files with 10,981 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build-cli.yml
@@ -0,0 +1,58 @@
name: Build Standalone CLI

on:
push:
tags:
- 'v*'

env:
CI: true

jobs:
build_cli:
runs-on: macos-11
steps:
- uses: actions/checkout@v2

- run: git fetch --tags

- name: Resolve version
id: vars
run: echo "::set-output name=tag_name::$(git describe --tags --abbrev=0)"

- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'

- name: Build tailwindcss
run: npm run prepublishOnly

- name: Install standalone cli dependencies
run: npm install
working-directory: standalone-cli

- name: Build standalone cli
run: npm run build
working-directory: standalone-cli

- name: Test
run: npm test
working-directory: standalone-cli

- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
tag_name: ${{ steps.vars.outputs.tag_name }}
body: |
* [Linux (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ steps.vars.outputs.tag_name }}/tailwindcss-linux-x64)
* [macOS (arm64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ steps.vars.outputs.tag_name }}/tailwindcss-macos-arm64)
* [macOS (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ steps.vars.outputs.tag_name }}/tailwindcss-macos-x64)
* [Windows (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ steps.vars.outputs.tag_name }}/tailwindcss-windows-x64.exe)
files: |
dist/tailwindcss-linux-x64
dist/tailwindcss-macos-arm64
dist/tailwindcss-macos-x64
dist/tailwindcss-windows-x64.exe
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Expand Up @@ -42,7 +42,7 @@ jobs:
CI: true

- name: Publish
run: npm publish --tag next
run: npm publish
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

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

### Fixed

Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -101,7 +101,8 @@
],
"testPathIgnorePatterns": [
"/node_modules/",
"/integrations/"
"/integrations/",
"/standalone-cli/"
],
"transform": {
"\\.js$": "@swc/jest"
Expand Down
2 changes: 2 additions & 0 deletions standalone-cli/.gitignore
@@ -0,0 +1,2 @@
node_modules
/dist
15 changes: 15 additions & 0 deletions standalone-cli/README.md
@@ -0,0 +1,15 @@
# Tailwind Standalone CLI

> Standalone version of [Tailwind CLI](https://tailwindcss.com/docs/installation#using-tailwind-cli)
## Installation

Download the appropriate platform-specific version of the `tailwindcss` cli from the [latest release](https://github.com/tailwindlabs/tailwindcss/releases).

## Usage

```
./tailwindcss-macos -o tailwind.css
```

Check out the [Tailwind CLI documentation](https://tailwindcss.com/docs/installation#using-tailwind-cli) for details on the available options.

0 comments on commit 47e8556

Please sign in to comment.