From 90df07c0480c7ced022c3428067be0f961db0841 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sat, 7 Dec 2024 12:03:05 -0500 Subject: [PATCH 1/2] Add a script to automate upstream bumps and update CONTRIBUTING.md --- CONTRIBUTING.md | 18 ++++++--- bin/bump-upstream | 99 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 6 deletions(-) create mode 100755 bin/bump-upstream diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a0bbc0..e4332fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,20 +4,26 @@ This doc is a brief introduction on modifying and maintaining this gem. ## Updating to the latest upstream tailwindcss version -Update `lib/tailwindcss/ruby/upstream.rb` with the upstream version. +Please don't submit PRs to the maintainer with an upstream bump. -Run `bundle exec rake clobber` then `bundle exec rake download` to ensure the tailwindcss binaries can be downloaded, and that you have the correct versions on local disk. +- [ ] run `bin/bump-upstream` +- [ ] push the branch, create a PR ## Cutting a release of tailwindcss-ruby -- bump the version +- if it's just bumping the upstream: + - [ ] follow the steps above + - [ ] when the PR is green, merge the PR + - [ ] create a git tag (after updating local `main`) +- else if the gem is being changed in some other way: - [ ] update `lib/tailwindcss/ruby/version.rb` - [ ] update `CHANGELOG.md` - - [ ] commit and create a git tag + - [ ] `git commit` + - [ ] `git tag` - build the native gems: - - [ ] `bundle exec rake clobber` if needed to clean up possibly-old tailwindcss executables + - [ ] `bundle exec rake clobber` (if needed to clean up old tailwindcss executables) - [ ] `bundle exec rake package` -- push +- push source and gems: - [ ] `for g in pkg/*.gem ; do gem push $g ; done` - [ ] `git push && git push --tags` - announce diff --git a/bin/bump-upstream b/bin/bump-upstream new file mode 100755 index 0000000..77fbbb0 --- /dev/null +++ b/bin/bump-upstream @@ -0,0 +1,99 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +if [[ $# -lt 1 ]] ; then + echo "Usage: $(basename $0) " + echo + echo "Where is the tag name of the Tailwind CSS release." + exit 1 +fi + +PAGER="" # we don't want gh to use a pager +git_cmd=$(command -v git) +gh_cmd=$(command -v gh) +sed_cmd=$(command -v sed) + +fail() { + echo "Error: $*" >&2 + exit 1 +} + +upstream_tag=$1 +gem_version=$(echo $upstream_tag | $sed_cmd -E 's/^v//' | sed -E 's/-/./') +gem_tag="v${gem_version}" + +github_user=$($git_cmd config github.user || true) +if [[ -z "$github_user" ]]; then + fail "github.user is not set in git config" +fi + +# view the release. will fail if the release does not exist +$gh_cmd release view ${upstream_tag} --repo tailwindlabs/tailwindcss + +# get on the right starting branch +if [[ -n "$($git_cmd status --porcelain --untracked-files=no)" ]]; then + fail "found uncommitted changes" +fi + +if [[ $upstream_tag =~ ^v4 ]] ; then + base_branch="v4.x" + + changelog_extra=$(cat </dev/null 2>&1; then + fail "current branch is not tracking a remote branch" +fi + +# +# modify the upstream version and gem version +# +$sed_cmd -E -i "s/^(\s+)VERSION\s+=.*/\1VERSION = \"${upstream_tag}\"/" lib/tailwindcss/ruby/upstream.rb +$sed_cmd -E -i "s/^(\s+)VERSION\s+=.*/\1VERSION = \"${gem_version}\"/" lib/tailwindcss/ruby/version.rb + +bundle install + +# +# modify the changelog +# +replacement_text=$(cat < Date: Mon, 10 Feb 2025 08:52:52 -0500 Subject: [PATCH 2/2] dep: update to Tailwind CSS v4.0.6 https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.6 --- CHANGELOG.md | 7 +++++++ Gemfile.lock | 2 +- lib/tailwindcss/ruby/upstream.rb | 2 +- lib/tailwindcss/ruby/version.rb | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7a67c6..d6920e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # tailwindcss-ruby changelog +## v4.0.6 + +* Update to [Tailwind CSS v4.0.6](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.6) @flavorjones + + Upgrade guide at https://tailwindcss.com/docs/upgrade-guide + + ## v4.0.5 * Update to [Tailwind CSS v4.0.5](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.5) @flavorjones diff --git a/Gemfile.lock b/Gemfile.lock index 5da88eb..1f20641 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - tailwindcss-ruby (4.0.5) + tailwindcss-ruby (4.0.6) GEM remote: https://rubygems.org/ diff --git a/lib/tailwindcss/ruby/upstream.rb b/lib/tailwindcss/ruby/upstream.rb index 4692f47..5eeb186 100644 --- a/lib/tailwindcss/ruby/upstream.rb +++ b/lib/tailwindcss/ruby/upstream.rb @@ -1,7 +1,7 @@ module Tailwindcss module Ruby module Upstream - VERSION = "v4.0.5" + VERSION = "v4.0.6" # rubygems platform name => upstream release filename NATIVE_PLATFORMS = { diff --git a/lib/tailwindcss/ruby/version.rb b/lib/tailwindcss/ruby/version.rb index aea027c..c84bb69 100644 --- a/lib/tailwindcss/ruby/version.rb +++ b/lib/tailwindcss/ruby/version.rb @@ -2,6 +2,6 @@ module Tailwindcss module Ruby - VERSION = "4.0.5" + VERSION = "4.0.6" end end