Skip to content

Conversation

@RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Jan 28, 2025

Now that Tailwind CSS v4 is released, we can setup a proper release workflow again. This setup mimics the workflow of how we did it in v3, but adjusted to make it work on the v4 codebase.

Whenever a PR is merged into the next branch, we will publish an insiders release to npm using the following version number: 0.0.0-insiders.<commit-hash>. Note: insiders releases will not have a GitHub release associated with them, therefore the standalone-cli won't be available as an insiders release.

For the normal release procedure, the following steps are required:

  1. Manually version the packages (e.g.: pnpm run version-packages)
  2. Create a git tag for the version you want to release
  3. Push the updated package.json files and the git tag to the repository

Next, a GitHub action will kick in once a tag is being pushed.

The GitHub action will run a build, and create a draft release on GitHub that will contain:

  1. The CHANGELOG.md contents for the last version
  2. The standalone-cli artifacts attached to the drafted release

Once you are happy with the draft, you can publish the draft on GitHub.

This in turn will trigger another GitHub action that will publish the packages to npm.

Whenever an insiders release or a normal release completes, we will also trigger Tailwind Play, to update its dependencies to the latest version of Tailwind CSS.


Note: some of the GitHub Action workflows still refer to the next branch instead of the main branch. If we later today want to get a new release out, we can merge next into main and update the workflows accordingly.


This is hard to test, but I started from the existing release.yml file and adjusted things accordingly. The biggest change is related to the insiders version. If you look at this temporary commit, you can see that the publishing (dry-run) seems to work as expected:
image

Trigger on pushes to the `next` branch, instead of relying on a manual
workflow dispatch.
If a version is passed, all packages will be set to that version.
This was already done during the prepare release step
This was already done during the prepare release step.
This will compute the release channel we are interested in. Typically,
this will be just `latest`, but could also be `beta` in case of
`5.0.0-beta.2`
Or manual workflow_dispatch trigger.
This should not be necessary anymore, the NPM tag will be published
based on the version in `package.json` of the `tailwindcss` package.
We will mostly always publish to `latest`, so this step is unnecessary.
@RobinMalfait RobinMalfait requested a review from a team as a code owner January 28, 2025 11:11

const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
const root = path.resolve(__dirname, '..')
const version = process.argv[2] || null
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just allows us to force a version without manually editing the versions. E.g.:

pnpm run version-packages 0.0.0-insiders.abc123

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooh this is handy 💯

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh nice

Copy link
Member Author

@RobinMalfait RobinMalfait Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't immediately find an option in pnpm to do that recursively, so thought to just add it to this little script 😄

Copy link
Member

@philipp-spiess philipp-spiess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff!

script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'tailwindlabs',
repo: 'play.tailwindcss.com',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to update play so that it uses v4 config for the insider build after that release cc @thecrypticace

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, @thecrypticace is aware of this 💪

@RobinMalfait RobinMalfait merged commit 515a9bd into next Jan 28, 2025
5 checks passed
@RobinMalfait RobinMalfait deleted the feat/setup-v4-releases branch January 28, 2025 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants