|
32 | 32 | - name: Install dependencies |
33 | 33 | run: npm ci --verbose |
34 | 34 |
|
| 35 | + - name: Build packages |
| 36 | + run: | |
| 37 | + # Build base dependencies |
| 38 | + npm run build --workspace=@slack/logger |
| 39 | + npm run build --workspace=@slack/types |
| 40 | +
|
| 41 | + # Build packages requiring base dependencies |
| 42 | + npm run build --workspace=@slack/web-api |
| 43 | + npm run build --workspace=@slack/webhook |
| 44 | +
|
| 45 | + # Build packages that depend on the Web API |
| 46 | + npm run build --workspace=@slack/oauth |
| 47 | + npm run build --workspace=@slack/rtm-api |
| 48 | + npm run build --workspace=@slack/socket-mode |
| 49 | +
|
35 | 50 | - name: Create or update release PR |
36 | 51 | id: changesets |
37 | 52 | uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0 |
@@ -109,9 +124,30 @@ jobs: |
109 | 124 | npm run build --workspace=@slack/socket-mode |
110 | 125 |
|
111 | 126 | - name: Publish to npm and create GitHub releases |
| 127 | + id: changesets |
112 | 128 | uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0 |
113 | 129 | with: |
114 | 130 | createGithubReleases: true |
115 | 131 | publish: npm run changeset -- publish |
116 | 132 | env: |
117 | 133 | GITHUB_TOKEN: ${{ steps.credentials.outputs.token }} |
| 134 | + |
| 135 | + - name: Get publication details |
| 136 | + if: steps.changesets.outputs.published == 'true' |
| 137 | + id: release |
| 138 | + run: | |
| 139 | + echo "message=$(echo "$PUBLISHED_PACKAGES" | jq -r '[.[] | "\(.name)@\(.version)"] | join(", ")')" >> "$GITHUB_OUTPUT" |
| 140 | + echo "action_url=$(echo "$PUBLISHED_PACKAGES" | jq -r '[.[] | "https://github.com/${{ github.repository }}/releases/tag/\(.name)@\(.version)"] | join("\n")')" >> "$GITHUB_OUTPUT" |
| 141 | + env: |
| 142 | + PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }} |
| 143 | + |
| 144 | + - name: Notify Slack |
| 145 | + if: steps.changesets.outputs.published == 'true' |
| 146 | + uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1 |
| 147 | + with: |
| 148 | + webhook: ${{ secrets.SLACK_RELEASE_ANNOUNCEMENTS_WEBHOOK_URL }} |
| 149 | + webhook-type: webhook-trigger |
| 150 | + payload: | |
| 151 | + action_url: "${{ steps.release.outputs.action_url }}" |
| 152 | + message: "${{ steps.release.outputs.message }}" |
| 153 | + repository: "${{ github.repository }}" |
0 commit comments