-
Notifications
You must be signed in to change notification settings - Fork 14
48 lines (39 loc) · 1.45 KB
/
build-tokens.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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'))
const outputFiles = fs.readdirSync('packages/tokens/dist')
return `# Build Tokens
| Input | Output |
| --- | --- |
| `tokens.json`:<br><pre>${JSON.stringify(input, null, 2)}</pre> | |
<pre>${outputFiles.join('\n')}</pre>
`
- name: Output Summary
run: echo -e ${{ steps.summary.outputs.result }} >> $GITHUB_STEP_SUMMARY