Skip to content

v4.0.0

v4.0.0 #8

Workflow file for this run

name: Publish
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Node 🧰
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Install 📦
run: npm ci
- name: Build 🛠
run: npm run build:types
- name: Publish 🚀 PRERELEASE
if: 'github.event.release.prerelease'
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
./node_modules/.bin/lerna publish from-git --dist-tag next --require-scripts --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish 🚀 PRODUCTION
if: '!github.event.release.prerelease'
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
./node_modules/.bin/lerna publish from-git --require-scripts --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Post to a Slack channel
id: slack
uses: slackapi/[email protected]
with:
# Slack channel id, channel name, or user id to post message.
# See also: https://api.slack.com/methods/chat.postMessage#channels
# channel-id: 'pipeline'
# For posting a rich message using Block Kit
payload: |
{
"text": "New release ${{github.ref_name}} for ${{github.event.repository.name}}.",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "New release for <${{github.event.repository.html_url}}|`${{github.event.repository.name}}`>\n*<${{github.event.release.html_url}}|release notes>*"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Project:*\n${{github.event.repository.name}}"
},
{
"type": "mrkdwn",
"text": "*Version:*\n${{github.ref_name}}"
}
]
},
{
"type": "context",
"elements": [
{
"type": "image",
"image_url": "${{github.event.sender.avatar_url}}",
"alt_text": "${{github.event.sender.login}}"
},
{
"type": "mrkdwn",
"text": "*${{github.event.sender.login}}* has triggered this release."
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.PIPELINE_SLACK_CHANNEL_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK