Skip to content

version packages (#4984) #844

version packages (#4984)

version packages (#4984) #844

Workflow file for this run

name: Changeset
on:
push:
branches:
- "main"
jobs:
version:
runs-on: ubuntu-latest
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
# deployment:
# runs-on: ubuntu-latest
# needs: version
# permissions:
# deployments: write
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/setup
# - uses: chrnorm/deployment-action@v2
# name: Create GitHub deployment
# id: deployment
# with:
# token: "$GITHUB_TOKEN"
# environment-url: http://cultureamp.design
# environment: production
# description: ${{ needs.version.outputs.publishedPackages }}
notify-slack:
runs-on: ubuntu-latest
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 }}