Skip to content

Commit

Permalink
chore: discord message
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Nov 23, 2023
1 parent 7e4dc87 commit 14ac7c6
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
TAG: ${{ inputs.tag }}
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: bun run release --concurrency=1 -- -tag beta
publish: bun run release

- name: Publish ${{ inputs.tag || 'canary' }}
continue-on-error: true
Expand All @@ -84,6 +82,29 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
TAG: canary
run: |
bun run release:canary --concurrency=1 -- -tag ${{ inputs.tag || 'canary' }}
bun run release:canary --tag ${{ inputs.tag || 'canary' }}
- name: Send a discord notification
if: steps.publish.outputs.published == 'true'
uses: actions/github-script@v6
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
fetch(process.env.DISCORD_WEBHOOK_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: `New release available. [Read the changelog](https://github.com/kubb-project/kubb/releases)`
}),
})
.then((res) => {
console.log('Sent discord notification', res)
})
.catch((err) => {
console.error('Error sending discord notification', err)
})

0 comments on commit 14ac7c6

Please sign in to comment.