Skip to content

Commit

Permalink
port over from KDS
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoffrey Chong committed Aug 24, 2023
1 parent 981467c commit e9fb06f
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions .github/workflows/changeset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,37 @@ jobs:
version:
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
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
id: changesets
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
- name: Push git tags
if: steps.changesets.outputs.published == 'true'
run: git push --follow-tags
notify:
notify-slack:
runs-on: ubuntu-latest
needs: version
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: Publish successful
if: needs.version.outputs.published == 'true'
uses: slackapi/[email protected]
with:
channel-id: "C02NUQ27G56"
slack-message: "Legacy Packages have been published"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: Publish failed
if: needs.version.outputs.published == 'false'
- name: Send
uses: slackapi/[email protected]
with:
channel-id: "C02NUQ27G56"
slack-message: "Legacy Publish failed"
slack-message: ${{ env.PUBLISHED == 'true' && 'Packages have been published' || 'Publishing failed' }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 comments on commit e9fb06f

Please sign in to comment.