Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/scripts/push-wai.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env zx
import 'zx/globals'
import { config, commitAndPush } from './commons.mjs'

const commitMessage = (await $`git log -1 --pretty=%B`).stdout
await commitAndPush(config, commitMessage)
30 changes: 20 additions & 10 deletions .github/scripts/wai-build.mjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
#!/usr/bin/env zx
import 'zx/globals';
import { config, cloneWcagActRules, commitAndPush } from './commons.mjs'
import { config, cloneWcagActRules } from './commons.mjs'

const ACT_TOOLS_PATH = process.env.ACT_TOOLS_PATH || './node_modules/act-tools';
Comment thread
G0dwin marked this conversation as resolved.
Outdated
Comment thread
Jym77 marked this conversation as resolved.
Outdated

await cloneWcagActRules(config);
await generateProposedRulePages(config);
await generateexamples(config);
const commitMessage = (await $`git log -1 --pretty=%B`).stdout;
await commitAndPush(config, commitMessage);
await generateGlossaryPage(config);

async function generateGlossaryPage({ tmpDir, rulesDir, glossaryDir, testAssetsDir }) {
await $`node ${ACT_TOOLS_PATH}/dist/cli/generate-glossary.js \
--rulesDir "${rulesDir}" \
--glossaryDir "${glossaryDir}" \
--testAssetsDir "${testAssetsDir}" \
--outDir "${tmpDir}"
`;
}

async function generateProposedRulePages({ tmpDir, rulesDir, glossaryDir, testAssetsDir }) {
await $`node ./node_modules/act-tools/dist/cli/rule-transform.js \
--rulesDir "${rulesDir}" \
--glossaryDir "${glossaryDir}" \
--testAssetsDir "${testAssetsDir}" \
--outDir "${tmpDir}" \
--proposed
await $`node ${ACT_TOOLS_PATH}/dist/cli/rule-transform.js \
--rulesDir "${rulesDir}" \
--glossaryDir "${glossaryDir}" \
--testAssetsDir "${testAssetsDir}" \
--outDir "${tmpDir}" \
--proposed
`;
}

async function generateexamples({ tmpDir, rulesDir, testAssetsDir }) {
await $`node ./node_modules/act-tools/dist/cli/build-examples.js \
await $`node ${ACT_TOOLS_PATH}/dist/cli/build-examples.js \
--rulesDir "${rulesDir}" \
--testAssetsDir "${testAssetsDir}" \
--outDir "${tmpDir}" \
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/wai-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ jobs:
git config --global url."https://${{ secrets.WAI_GIT_NAME }}:${{ secrets.WAI_GIT_ACCESS_TOKEN }}@github.com".insteadOf "https://github.com"
git config --global user.name "${{ secrets.WAI_GIT_NAME }}"
git config --global user.email "${{ secrets.WAI_GIT_EMAIL }}"
- name: Build and deploy WAI update
- name: Build WAI update
run: npm run build:wai
- name: Push WAI update
run: npm run push:wai
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
"format": "prettier --write *.{json,md,js,html,css,yml} './{__tests__,_rules,.github,pages,test-assets,test-utils,utils}/**/*.{json,md,js,html,css,yml}'",
"test": "jest --coverage",
"build:wai": "zx .github/scripts/wai-build.mjs",
"push:wai": "zx .github/scripts/wai-push.mjs",
"pr:preview": "zx .github/scripts/pr-preview.mjs"
},
"homepage": "https://github.com/act-rules/act-rules.github.io",
Expand Down