diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml new file mode 100644 index 0000000..ae24c12 --- /dev/null +++ b/.github/workflows/prepare-release.yml @@ -0,0 +1,56 @@ +name: Prepare Release + +on: + workflow_dispatch: + push: + tags: + - 'v*' + +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: Install dependencies + run: npm install + + - name: Test + run: npm test + + - 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..1a9a2b1 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,20 @@ 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- + cache: 'npm' - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' run: npm install - env: - CI: true - name: Resolve version id: vars @@ -50,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 new file mode 100644 index 0000000..a4482d0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +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@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: Install dependencies + run: npm install + + - name: Test + run: npm test + + - 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 }} 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