From fb86556bb1e9f222ff130a6c5919ff43bdf8120c Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Wed, 28 Aug 2024 14:29:52 +0200 Subject: [PATCH 1/3] Add CI pipeline for releases and clean up the workflows --- .github/workflows/prepare-release.yml | 58 ++++++++++++++++++++++++++ .github/workflows/release-insiders.yml | 24 +++-------- .github/workflows/release.yml | 41 ++++++++++++++++++ 3 files changed, 104 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/prepare-release.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml new file mode 100644 index 0000000..f707b09 --- /dev/null +++ b/.github/workflows/prepare-release.yml @@ -0,0 +1,58 @@ +name: Prepare Release + +on: + workflow_dispatch: + push: + tags: + - 'v*' + +env: + CI: true + +permissions: + contents: read + +jobs: + prepare: + permissions: + contents: write # for softprops/action-gh-release to create GitHub release + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [22] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + + - name: Test + run: npm test + env: + CI: true + + - name: Resolve version + id: vars + run: | + echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + + - name: Get release notes + run: | + RELEASE_NOTES=$(npm run release-notes --silent) + echo "RELEASE_NOTES<> $GITHUB_ENV + echo "$RELEASE_NOTES" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - name: Release + uses: softprops/action-gh-release@v1 + with: + draft: true + tag_name: ${{ env.TAG_NAME }} + body: ${{ env.RELEASE_NOTES }} diff --git a/.github/workflows/release-insiders.yml b/.github/workflows/release-insiders.yml index 2d77e8e..b8fd807 100644 --- a/.github/workflows/release-insiders.yml +++ b/.github/workflows/release-insiders.yml @@ -2,7 +2,7 @@ name: Release Insiders on: push: - branches: [master] + branches: [main] permissions: contents: read @@ -14,31 +14,17 @@ jobs: strategy: matrix: - node-version: [12] + node-version: [22] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} registry-url: 'https://registry.npmjs.org' - - - name: Use cached node_modules - id: cache - uses: actions/cache@v2 - with: - path: node_modules - key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }} - restore-keys: | - nodeModules- - - - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' - run: npm install - env: - CI: true + cache: 'npm' - name: Resolve version id: vars diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d9f7b39 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: Release + +on: + release: + types: [published] + +permissions: + contents: read + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [22] + + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + + - name: Test + run: npm test + env: + CI: true + + - name: Calculate environment variables + run: | + echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV + + - name: Publish + run: npm publish --provenance --tag ${{ env.RELEASE_CHANNEL }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From c3d7727fdc42a0ed7cf4a9f6b0f972c1462d1e74 Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Wed, 28 Aug 2024 14:29:58 +0200 Subject: [PATCH 2/3] Simplify change log wording --- .github/workflows/release.yml | 4 ++-- CHANGELOG.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9f7b39..ba41791 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,10 +17,10 @@ jobs: node-version: [22] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} registry-url: 'https://registry.npmjs.org' diff --git a/CHANGELOG.md b/CHANGELOG.md index f7352c5..bfdbd89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Update `tailwindcss` peer dependency to include `4.0.0-alpha.20` which adds support for this plugin ([#163](https://github.com/tailwindlabs/tailwindcss-forms/pull/163)) +- Support installing with alpha versions of Tailwind CSS v4 ([#163](https://github.com/tailwindlabs/tailwindcss-forms/pull/163)) ## [0.5.7] - 2023-11-10 From 054bae4ecc2a164b7b6797f205355dba12937dfb Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Wed, 28 Aug 2024 14:35:44 +0200 Subject: [PATCH 3/3] Add npm install and remove default CI flag --- .github/workflows/prepare-release.yml | 8 +++----- .github/workflows/release-insiders.yml | 4 +++- .github/workflows/release.yml | 5 +++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index f707b09..ae24c12 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -6,9 +6,6 @@ on: tags: - 'v*' -env: - CI: true - permissions: contents: read @@ -33,10 +30,11 @@ jobs: registry-url: 'https://registry.npmjs.org' cache: 'npm' + - name: Install dependencies + run: npm install + - name: Test run: npm test - env: - CI: true - name: Resolve version id: vars diff --git a/.github/workflows/release-insiders.yml b/.github/workflows/release-insiders.yml index b8fd807..1a9a2b1 100644 --- a/.github/workflows/release-insiders.yml +++ b/.github/workflows/release-insiders.yml @@ -26,6 +26,9 @@ jobs: registry-url: 'https://registry.npmjs.org' cache: 'npm' + - name: Install dependencies + run: npm install + - name: Resolve version id: vars run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" @@ -36,5 +39,4 @@ jobs: - name: Publish run: npm publish --provenance --tag insiders env: - CI: true NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba41791..a4482d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,10 +26,11 @@ jobs: registry-url: 'https://registry.npmjs.org' cache: 'npm' + - name: Install dependencies + run: npm install + - name: Test run: npm test - env: - CI: true - name: Calculate environment variables run: |