Changeset: Version packages (#65) #63
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: Changeset | |
on: | |
push: | |
branches: | |
- "main" | |
jobs: | |
version: | |
runs-on: ubuntu-latest | |
outputs: | |
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }} | |
hasPublished: ${{ steps.changesets.outputs.published }} | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup | |
- name: Create Release Pull Request or Publish to npm | |
run: | | |
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN" | |
- uses: changesets/action@v1 | |
id: changesets | |
with: | |
title: "Changeset: Version packages" | |
commit: "version packages" | |
version: yarn ci:version | |
publish: yarn ci:publish | |
notify-slack: | |
runs-on: ubuntu-latest | |
needs: | |
version | |
# We only trigger this flow if the publish is happening, inferred by not having a changeset. | |
if: needs.version.outputs.hasChangesets == 'false' | |
env: | |
PUBLISHED: ${{ needs.version.outputs.hasPublished }} | |
steps: | |
- name: Send | |
uses: slackapi/[email protected] | |
with: | |
channel-id: "C02NUQ27G56" | |
slack-message: ${{ env.PUBLISHED == 'true' && 'Legacy packages have been published' || 'Legacy Publishing failed' }} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |