Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
391f9cb
copy release into release-insiders
RobinMalfait Jan 27, 2025
7968f97
rename workflow
RobinMalfait Jan 27, 2025
d82e305
adjust trigger
RobinMalfait Jan 27, 2025
3ef6f6d
compute hash instead of relying on tag name
RobinMalfait Jan 27, 2025
7787979
accept optional version when running `version-packages`
RobinMalfait Jan 27, 2025
350c5d8
version packages using commit hash
RobinMalfait Jan 27, 2025
13fba6d
do not compute release notes
RobinMalfait Jan 27, 2025
67fe942
do not upload artifacts for standalone CLI
RobinMalfait Jan 27, 2025
cf82f16
do not alias packages to `latest`
RobinMalfait Jan 27, 2025
526edeb
do not create a GitHub release
RobinMalfait Jan 27, 2025
2f231b4
set `env.RELEASE_CHANNEL`
RobinMalfait Jan 27, 2025
afdde33
use `env.RELEASE_CHANNEL`
RobinMalfait Jan 27, 2025
ec7c175
trigger prepare release when pushing a tag
RobinMalfait Jan 27, 2025
20d8f53
copy release workflow into prepare-release.yml
RobinMalfait Jan 27, 2025
ee57733
remove publish and alias package step
RobinMalfait Jan 27, 2025
cb673b8
rename release to prepare
RobinMalfait Jan 27, 2025
9c6d5aa
remove release notes from release
RobinMalfait Jan 28, 2025
109dcbf
do not upload standalone CLI artifacts
RobinMalfait Jan 28, 2025
906bba6
do not create a GitHub release
RobinMalfait Jan 28, 2025
45d928b
add `scripts/release-channel.js`
RobinMalfait Jan 28, 2025
4f15777
trigger release when GitHub release is published
RobinMalfait Jan 28, 2025
206bdbb
remove `TAG_NAME` calculation
RobinMalfait Jan 28, 2025
aec1614
compute RELEASE_CHANNEL based on version number
RobinMalfait Jan 28, 2025
a1580e2
do not alias packages to `latest`
RobinMalfait Jan 28, 2025
f80eb9e
trigger a Tailwind Play update once the publish step is complete
RobinMalfait Jan 28, 2025
5c2d772
trigger Tailwind Play update when insiders release is published
RobinMalfait Jan 28, 2025
523faf8
use `actions.github-script@v7`
RobinMalfait Jan 28, 2025
572dddf
tmp: trigger insiders release (dry run) from branch
RobinMalfait Jan 28, 2025
710c9bf
Revert "tmp: trigger insiders release (dry run) from branch"
RobinMalfait Jan 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 242 additions & 6 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,257 @@ name: Prepare Release

on:
workflow_dispatch:
push:
tags:
- 'v*'

env:
CI: true
APP_NAME: tailwindcss-oxide
NODE_VERSION: 20
OXIDE_LOCATION: ./crates/node

permissions:
contents: read

jobs:
build:
runs-on: macos-12
timeout-minutes: 15

strategy:
matrix:
node-version: [16]
include:
# Windows
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
# macOS
- os: macos-latest
target: x86_64-apple-darwin
strip: strip -x # Must use -x on macOS. This produces larger results on linux.
- os: macos-latest
target: aarch64-apple-darwin
page-size: 14
strip: strip -x # Must use -x on macOS. This produces larger results on linux.
# Android
- os: ubuntu-latest
target: aarch64-linux-android
strip: ${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip
- os: ubuntu-latest
target: armv7-linux-androideabi
strip: ${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip
# Linux
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
strip: strip
container:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
strip: llvm-strip
container:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
- os: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
strip: llvm-strip
container:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-zig
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
strip: aarch64-linux-musl-strip
download: true
container:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
strip: strip
download: true
container:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine

name: Build ${{ matrix.target }} (OXIDE)
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'

# Cargo already skips downloading dependencies if they already exist
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}

# Cache the `oxide` Rust build
- name: Cache oxide build
uses: actions/cache@v4
with:
path: |
./oxide/target/
./crates/node/*.node
./crates/node/index.js
./crates/node/index.d.ts
key: ${{ runner.os }}-${{ matrix.target }}-oxide-${{ hashFiles('./crates/**/*') }}

- name: Install Node.JS
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install Rust (Stable)
if: ${{ matrix.download }}
run: |
rustup default stable

- name: Setup rust target
run: rustup target add ${{ matrix.target }}

- name: Install dependencies
run: pnpm install --ignore-scripts --filter=!./playgrounds/*

- name: Build release
run: pnpm run --filter ${{ env.OXIDE_LOCATION }} build
env:
RUST_TARGET: ${{ matrix.target }}
JEMALLOC_SYS_WITH_LG_PAGE: ${{ matrix.page-size }}

- name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034
if: ${{ matrix.strip }}
run: ${{ matrix.strip }} ${{ env.OXIDE_LOCATION }}/*.node

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.target }}
path: ${{ env.OXIDE_LOCATION }}/*.node

prepare:
runs-on: macos-14
timeout-minutes: 15
name: Build and release Tailwind CSS

permissions:
contents: write # for softprops/action-gh-release to create GitHub release
# https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions
id-token: write

needs:
- build

steps:
- run: echo "stub"
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 20

- run: git fetch --tags -f

- name: Resolve version
id: vars
run: |
echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV

- uses: pnpm/action-setup@v4

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

# Cargo already skips downloading dependencies if they already exist
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}

# Cache the `oxide` Rust build
- name: Cache oxide build
uses: actions/cache@v4
with:
path: |
./oxide/target/
./crates/node/*.node
./crates/node/index.js
./crates/node/index.d.ts
key: ${{ runner.os }}-${{ matrix.target }}-oxide-${{ hashFiles('./crates/**/*') }}

- name: Install dependencies
run: pnpm --filter=!./playgrounds/* install

- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ${{ env.OXIDE_LOCATION }}

- name: Move artifacts
run: |
cd ${{ env.OXIDE_LOCATION }}
cp bindings-x86_64-pc-windows-msvc/* ./npm/win32-x64-msvc/
cp bindings-aarch64-pc-windows-msvc/* ./npm/win32-arm64-msvc/
cp bindings-x86_64-apple-darwin/* ./npm/darwin-x64/
cp bindings-aarch64-apple-darwin/* ./npm/darwin-arm64/
cp bindings-aarch64-linux-android/* ./npm/android-arm64/
cp bindings-armv7-linux-androideabi/* ./npm/android-arm-eabi/
cp bindings-aarch64-unknown-linux-gnu/* ./npm/linux-arm64-gnu/
cp bindings-aarch64-unknown-linux-musl/* ./npm/linux-arm64-musl/
cp bindings-armv7-unknown-linux-gnueabihf/* ./npm/linux-arm-gnueabihf/
cp bindings-x86_64-unknown-linux-gnu/* ./npm/linux-x64-gnu/
cp bindings-x86_64-unknown-linux-musl/* ./npm/linux-x64-musl/

- name: Build Tailwind CSS
run: pnpm run build

- name: Run pre-publish optimizations scripts
run: node ./scripts/pre-publish-optimizations.mjs

- name: Lock pre-release versions
run: node ./scripts/lock-pre-release-versions.mjs

- name: Get release notes
run: |
RELEASE_NOTES=$(node ./scripts/release-notes.mjs)
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
echo "$RELEASE_NOTES" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- name: Upload Standalone Artifacts
uses: actions/upload-artifact@v4
with:
name: tailwindcss-standalone
path: packages/@tailwindcss-standalone/dist/

- name: Prepare GitHub Release
uses: softprops/action-gh-release@v2
with:
draft: true
tag_name: ${{ env.TAG_NAME }}
body: |
${{ env.RELEASE_NOTES }}
files: |
packages/@tailwindcss-standalone/dist/sha256sums.txt
packages/@tailwindcss-standalone/dist/tailwindcss-linux-arm64
packages/@tailwindcss-standalone/dist/tailwindcss-linux-arm64-musl
packages/@tailwindcss-standalone/dist/tailwindcss-linux-x64
packages/@tailwindcss-standalone/dist/tailwindcss-linux-x64-musl
packages/@tailwindcss-standalone/dist/tailwindcss-macos-arm64
packages/@tailwindcss-standalone/dist/tailwindcss-macos-x64
packages/@tailwindcss-standalone/dist/tailwindcss-windows-x64.exe
Loading