Skip to content

Commit

Permalink
chore: add check-for-changes script
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Sep 15, 2021
1 parent 717d6ce commit 8dfdd56
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ template:

percy:
- actions/percy/**/*
o-audio:
- components/o-audio/**/*
o-autocomplete:
- components/o-autocomplete/**/*
o-banner:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/check-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: check if monorepo config needs regenerated (npm run regenerate)
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'npm'
- run: npm install
- run: npm run regenerate
- run: ./scripts/check-for-changes.bash
43 changes: 43 additions & 0 deletions .github/workflows/percy-components-o-audio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Percy components/o-audio
on:
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- "components/o-audio/package.json"
- "components/o-audio/package-lock.json"
- "components/o-audio/origami.json"
- "components/o-audio/main.js"
- "components/o-audio/main.scss"
- "components/o-audio/demos/**"
- "components/o-audio/src/**"
push:
branches: main
paths:
- "components/o-audio/package.json"
- "components/o-audio/package-lock.json"
- "components/o-audio/origami.json"
- "components/o-audio/main.js"
- "components/o-audio/main.scss"
- "components/o-audio/demos/**"
- "components/o-audio/src/**"

jobs:
percy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
cache: 'npm'
node-version: 16
- run: npm ci
- uses: ./actions/percy/
with:
# To comment as the Origami Fox mascot GitHub user
github-token: ${{secrets.ORIGAMI_FOX_ACCESS_TOKEN}}
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_COMPONENTS_O_AUDIO }}
WORKSPACE: components/o-audio
22 changes: 22 additions & 0 deletions .github/workflows/test-components-o-audio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: test components/o-audio
concurrency:
group: ${{ github.head_ref }}-components/o-audio
cancel-in-progress: true

on:
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'npm'
- run: npm ci
- run: npx npm exec -w components/o-audio -- origami-build-tools verify
- run: npx npm exec -w components/o-audio -- origami-build-tools test
39 changes: 21 additions & 18 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,53 @@
{
"components/o-autocomplete": "1.3.4",
"components/o-autoinit": "3.1.0",
"components/o-audio": "2.0.0",
"components/o-autocomplete": "1.3.0",
"components/o-banner": "4.0.0",
"components/o-brand": "4.0.3",
"components/o-big-number": "3.0.0",
"components/o-buttons": "7.0.0",
"components/o-colors": "6.2.2",
"components/o-colors": "6.1.0",
"components/o-comments": "8.1.1",
"components/o-cookie-message": "6.0.1",
"components/o-date": "5.0.0",
"components/o-editorial-layout": "2.0.0",
"components/o-date": "5.0.1",
"components/o-editorial-layout": "2.0.1",
"components/o-editorial-typography": "2.0.2",
"components/o-errors": "5.1.0",
"components/o-expander": "6.0.0",
"components/o-fonts": "5.0.2",
"components/o-footer": "9.1.0",
"components/o-footer": "9.0.1",
"components/o-footer-services": "4.0.2",
"components/o-forms": "9.0.1",
"components/o-ft-affiliate-ribbon": "5.0.0",
"components/o-grid": "6.0.0",
"components/o-header": "9.0.2",
"components/o-header-services": "5.0.2",
"components/o-header": "9.0.1",
"components/o-header-services": "5.0.1",
"components/o-icons": "7.0.1",
"components/o-labels": "6.0.0",
"components/o-layout": "5.0.4",
"components/o-lazy-load": "3.0.0",
"components/o-loading": "5.0.0",
"components/o-message": "5.0.0",
"components/o-meter": "3.0.0",
"components/o-normalise": "3.0.1",
"components/o-overlay": "4.0.0",
"components/o-quote": "5.0.1",
"components/o-share": "8.0.0",
"components/o-spacing": "3.0.1",
"components/o-stepped-progress": "3.0.0",
"components/o-subs-card": "5.0.1",
"components/o-subs-card": "6.0.0",
"components/o-syntax-highlight": "4.0.0",
"components/o-table": "9.1.1",
"components/o-table": "9.0.2",
"components/o-tabs": "6.0.0",
"components/o-teaser": "6.0.2",
"components/o-teaser-collection": "4.0.0",
"components/o-toggle": "3.0.0",
"components/o-tooltip": "5.0.1",
"components/o-topper": "5.1.0",
"components/o-tracking": "4.1.2",
"components/o-topper": "5.0.1",
"components/o-typography": "7.0.2",
"components/o-video": "7.0.1",
"components/o-viewport": "5.0.1",
"components/o-visual-effects": "4.0.2",
"libraries/o-utils": "3.1.0"
"components/o-video": "7.0.2",
"components/o-viewport": "5.0.0",
"components/o-visual-effects": "4.0.1",
"libraries/o-autoinit": "3.0.0",
"libraries/o-brand": "4.0.2",
"libraries/o-errors": "5.1.0",
"libraries/o-tracking": "4.1.2",
"libraries/o-utils": "2.0.0"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"description": "the reference implementation of the FT's design system",
"type": "module",
"scripts": {
"regenerate": "node ./scripts/regenerate-ci-config-files.js",
"test": "node ./scripts/test.js",
"install": "cp hooks/* .git/hooks && cd tools/origami-build-tools && npm ci"
},
Expand Down
17 changes: 10 additions & 7 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
{
"bootstrap-sha": "fd786c42affbe1a13b891e0b143b225b55f43035",
"bootstrap-sha": "1b975669fa23f7344f7d0b2e62ae477357139312",
"packages": {
"components/o-audio": {},
"components/o-autocomplete": {},
"libraries/o-autoinit": {},
"components/o-banner": {},
"libraries/o-brand": {},
"components/o-big-number": {},
"components/o-buttons": {},
"components/o-colors": {},
"components/o-comments": {},
"components/o-cookie-message": {},
"components/o-date": {},
"components/o-editorial-layout": {},
"components/o-editorial-typography": {},
"libraries/o-errors": {},
"components/o-expander": {},
"components/o-fonts": {},
"components/o-footer": {},
Expand All @@ -28,6 +27,7 @@
"components/o-lazy-load": {},
"components/o-loading": {},
"components/o-message": {},
"components/o-meter": {},
"components/o-normalise": {},
"components/o-overlay": {},
"components/o-quote": {},
Expand All @@ -43,11 +43,14 @@
"components/o-toggle": {},
"components/o-tooltip": {},
"components/o-topper": {},
"components/o-tracking": {},
"components/o-typography": {},
"libraries/o-utils": {},
"components/o-video": {},
"components/o-viewport": {},
"components/o-visual-effects": {}
"components/o-visual-effects": {},
"libraries/o-autoinit": {},
"libraries/o-brand": {},
"libraries/o-errors": {},
"libraries/o-tracking": {},
"libraries/o-utils": {}
}
}
7 changes: 7 additions & 0 deletions scripts/check-for-changes.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
if [ $(git diff | wc -l) -gt 0 ]; then
echo something changed
echo
echo 'run "npm install" and "npm run regenerate" and commit the changes'
exit 22
fi
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ async function hasScript(workspace, name) {

await del([".github/workflows/percy-*.yml", ".github/workflows/test-*.yml"])

let dotReleasePleaseManifest = {}
let releasePleaseConfig = {
"bootstrap-sha": "1b975669fa23f7344f7d0b2e62ae477357139312",
packages: {},
}

for (let workspace of workspacePaths) {
let view = {
lint: "",
Expand Down Expand Up @@ -75,4 +81,19 @@ for (let workspace of workspacePaths) {
percyFile
)
}

if (workspace.match(/^(components|libraries)\//)) {
let pkg = await readPackage({cwd: workspace})
dotReleasePleaseManifest[workspace] = pkg.version
releasePleaseConfig.packages[workspace] = {}
}
}

await writeFile(
".release-please-manifest.json",
JSON.stringify(dotReleasePleaseManifest, null, 2) + "\n"
)
await writeFile(
"release-please-config.json",
JSON.stringify(releasePleaseConfig, null, "\t") + "\n"
)

0 comments on commit 8dfdd56

Please sign in to comment.