Skip to content

feat(workflows): add a build-tokens workflow #4

feat(workflows): add a build-tokens workflow

feat(workflows): add a build-tokens workflow #4

Workflow file for this run

name: Build Tokens
on:
pull_request:
types: [opened, synchronize, edited, reopened]
paths:
- 'packages/tokens/**'
jobs:
build:
name: Build Tokens
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup-pnpm
- name: Install dependencies
run: pnpm --filter ...design-system-tokens... install
- name: Build tokens & dependencies
run: pnpm --filter ...design-system-tokens... build
# TODOs:
# - Add changeset to the tokens package? (not sure if this should be done manually)
# - Build all packages which are dependant on the tokens --filter ...design-system-tokens
# (styles and components for sure, maybe more)
- name: Create Summary
id: summary
uses: actions/github-script@v7
with:
script: |
const fs = require('fs')
const input = JSON.parse(fs.readFileSync('packages/tokens/tokensstudio-generated/tokens.json', 'utf8'))
return `# Build Tokens
- Input:
<pre>${JSON.stringify(input, null, 2)}</pre>
`
- name: Output Summary
run: echo -e ${{ steps.summary.outputs.result }} >> $GITHUB_STEP_SUMMARY