diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c689200d..fc435d4e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9db46a335..60aa26070 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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<> $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 diff --git a/packages/@tailwindcss-standalone/package.json b/packages/@tailwindcss-standalone/package.json index f76591db6..d3647508b 100644 --- a/packages/@tailwindcss-standalone/package.json +++ b/packages/@tailwindcss-standalone/package.json @@ -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", diff --git a/scripts/release-notes.mjs b/scripts/release-notes.mjs new file mode 100644 index 000000000..289cb1d96 --- /dev/null +++ b/scripts/release-notes.mjs @@ -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}`) +} diff --git a/scripts/version-packages.mjs b/scripts/version-packages.mjs index 86d399c9c..91660a557 100644 --- a/scripts/version-packages.mjs +++ b/scripts/version-packages.mjs @@ -30,6 +30,7 @@ const syncedWorkspaces = new Map([ 'crates/node/npm/win32-x64-msvc', ], ], + ['@tailwindcss/cli', ['packages/@tailwindcss-standalone']], ]) const inverseSyncedWorkspaces = new Map()