Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically trigger Tailwind Play PRs on release #9601

Merged
merged 2 commits into from Oct 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/release.yml
Expand Up @@ -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 }}'
}
})