release: version packages (#3075) #1071
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
# Setup | |
- uses: actions/checkout@v3 | |
- uses: pnpm/[email protected] # Uses version from package.json#packageManager | |
- name: Setup Node (using .node-version) | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.node-version' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
# Publish to npm | |
- name: Build packages | |
run: pnpm build | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
title: 'release: version packages' | |
publish: pnpm changeset publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# Send Slack Notification | |
- name: Create release notification | |
if: steps.changesets.outputs.published == 'true' | |
run: pnpm release:notification --packages '${{ steps.changesets.outputs.publishedPackages }}' | |
- name: Slack Notification | |
if: steps.changesets.outputs.published == 'true' | |
uses: slackapi/[email protected] | |
with: | |
payload-file-path: './slack-notification.json' | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_HOOK }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
# Deploy Docs on Vercel | |
- name: Deploy Docs | |
if: steps.changesets.outputs.published == 'true' | |
run: curl -X POST $VERCEL_DEPLOY_DOCS_HOOK |