Skip to content

feat: add discord bot step to release (#967) #263

feat: add discord bot step to release (#967)

feat: add discord bot step to release (#967) #263

Workflow file for this run

name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
release:
name: Release
runs-on: ubuntu-latest
environment: production
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Setup PNPM
# You may pin to the exact commit or the version.
# uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
uses: pnpm/action-setup@v4
with:
# Version of PNPM to install
version: 9.15.2
# Where to store PNPM files
# dest: # optional, default is ~/setup-pnpm
# If specified, run `pnpm install`
# run_install: true
- name: Cache pnpm modules
uses: actions/cache@v4
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: ${{ runner.os }}-${{ env.cache-name }}-
- name: Install dependencies
run: pnpm install
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- if: steps.changesets.outputs.published == 'true'
name: Github Releases To Discord
uses: sillyangel/releases-to-discord@v1
with:
webhook_url: ${{ secrets.WEBHOOK_URL }}
color: "2105893"
username: "Release Changelog"
avatar_url: "https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png"