-
Notifications
You must be signed in to change notification settings - Fork 23
49 lines (46 loc) · 1.49 KB
/
changeset.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Changeset
on:
push:
branches:
- 'main'
jobs:
version:
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
hasPublished: ${{ steps.changesets.outputs.published }}
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v4
- 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: pnpm ci:version
publish: pnpm ci:publish
notify-slack:
runs-on: ubuntu-latest
timeout-minutes: 5
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' && 'Packages have been published' || 'Publishing failed' }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}