mirror of
https://github.com/hanzoai/tailwindcss.git
synced 2026-09-24 17:03:14 +00:00
Add GitHub release workflow (#14346)
Co-authored-by: Philipp Spiess <[email protected]>
This commit is contained in:
committed by
GitHub
co-authored by
Philipp Spiess
parent
4a460b96e2
commit
8a06e88ea1
@@ -2,14 +2,14 @@ name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, next]
|
||||
branches: [next]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
tests:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@@ -139,7 +139,7 @@ jobs:
|
||||
path: ${{ env.OXIDE_LOCATION }}/*.node
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: macos-14
|
||||
timeout-minutes: 15
|
||||
name: Build and release Tailwind CSS
|
||||
|
||||
@@ -160,7 +160,6 @@ jobs:
|
||||
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
|
||||
@@ -186,7 +185,7 @@ jobs:
|
||||
key: ${{ runner.os }}-${{ matrix.target }}-oxide-${{ hashFiles('./crates/**/*') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm --filter=!./playgrounds/* install --ignore-scripts
|
||||
run: pnpm --filter=!./playgrounds/* install
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -216,13 +215,35 @@ jobs:
|
||||
- name: Lock pre-release versions
|
||||
run: node ./scripts/lock-pre-release-versions.mjs
|
||||
|
||||
- name: Publish
|
||||
run: pnpm --recursive publish --tag ${{ inputs.release_channel }} --no-git-checks
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- 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: Publish
|
||||
run: pnpm --recursive publish --tag ${{ inputs.release_channel }} --no-git-checks
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: 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-x64
|
||||
packages/@tailwindcss-standalone/dist/tailwindcss-macos-arm64
|
||||
packages/@tailwindcss-standalone/dist/tailwindcss-macos-x64
|
||||
packages/@tailwindcss-standalone/dist/tailwindcss-windows-x64.exe
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "@tailwindcss/standalone",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"private": true,
|
||||
"description": "Standalone CLI for Tailwind CSS",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -23,10 +24,6 @@
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"publishConfig": {
|
||||
"provenance": true,
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/cli": "workspace:^",
|
||||
"detect-libc": "1.0.3",
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Given a version, figure out what the release notes are so that we can use this to pre-fill the
|
||||
// relase notes on a GitHub release for the current version.
|
||||
|
||||
import * as fs from 'node:fs/promises'
|
||||
import * as path from 'node:path'
|
||||
import * as url from 'node:url'
|
||||
|
||||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
|
||||
|
||||
let version = process.argv[2] || process.env.npm_package_version
|
||||
if (!version) {
|
||||
let pkgPath = path.resolve(__dirname, '../packages/tailwindcss/package.json')
|
||||
let pkg = await fs.readFile(pkgPath, 'utf8').then(JSON.parse)
|
||||
|
||||
version = pkg.version
|
||||
}
|
||||
|
||||
let changelog = await fs.readFile(path.resolve(__dirname, '..', 'CHANGELOG.md'), 'utf8')
|
||||
let match = new RegExp(
|
||||
`## \\[${version}\\] - (.*)\\n\\n([\\s\\S]*?)\\n(?:(?:##\\s)|(?:\\[))`,
|
||||
'g',
|
||||
).exec(changelog)
|
||||
|
||||
if (match) {
|
||||
let [, , notes] = match
|
||||
console.log(notes.trim())
|
||||
} else {
|
||||
console.log(`Placeholder release notes for version: v${version}`)
|
||||
}
|
||||
@@ -30,6 +30,7 @@ const syncedWorkspaces = new Map([
|
||||
'crates/node/npm/win32-x64-msvc',
|
||||
],
|
||||
],
|
||||
['@tailwindcss/cli', ['packages/@tailwindcss-standalone']],
|
||||
])
|
||||
|
||||
const inverseSyncedWorkspaces = new Map()
|
||||
|
||||
Reference in New Issue
Block a user