From 24fc365173da15f922c486a9b0b7710e09268501 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Tue, 18 Oct 2022 16:06:53 +0200 Subject: [PATCH] Automatically trigger Tailwind Play PRs on release (#9601) * trigger a Taiwind Play build on release * ensure version has quotes --- .github/workflows/release.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa52adb78..e54466bdb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,12 +45,29 @@ jobs: env: CI: true - - name: Calculate tag + - name: Calculate environment variables run: | echo "tag_name=$(npm run calculate-tag-name --silent)" >> $GITHUB_ENV + echo "tailwindcss_version=$(node -e 'console.log(require(`./package.json`).version);')" >> $GITHUB_ENV - name: Publish run: npm publish --tag ${{ env.tag_name }} env: CI: true NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Trigger Tailwind Play update + if: env.tag_name == 'latest' + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.TAILWIND_PLAY_TOKEN }} + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: 'tailwindlabs', + repo: 'play.tailwindcss.com', + ref: 'master', + workflow_id: 'upgrade-tailwindcss.yml', + inputs: { + version: '${{ env.tailwindcss_version }}' + } + })