Skip to content

Commit

Permalink
Fix min dep jq script
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Jul 13, 2023
1 parent e356b11 commit d8a9f42
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- name:
Create NPM cache-hash input file and reduced-dependencies package.json
- name: Create NPM cache-hash input file
run: |
mkdir -p tmp
jq '{devDependencies, dependencies, engines, gitHubActionCacheCounter}' package.json > tmp/package-ci.json
jq 'del(.devDependencies[] | select(test("spell|gulp|netlify|prettier|require|text")))' package.json > tmp/package-min.json
mv tmp/package-min.json package.json
jq '{devDependencies, dependencies, engines, gitHubActionCacheKey}' package.json > tmp/package-ci.json
- name: Create and use reduced-dependencies package.json
run: |
jq '.devDependencies |= with_entries(
select(.key | test("spell|gulp|netlify|prettier|require|text") | not)
)
| del(.dependencies)' \
package.json > tmp/package-min.json
cp tmp/package-min.json package.json
- uses: actions/setup-node@v3
with:
Expand All @@ -29,11 +35,12 @@ jobs:
- run: npm run _check:links

- name: Upload build log
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build-log-etc
path: |
tmp/build-log.txt
tmp/package*.json
tmp/.htmltest/refcache.json
check-refcache:
Expand All @@ -44,7 +51,7 @@ jobs:
- uses: actions/checkout@v3

- name: Download build log
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: build-log-etc
path: tmp
Expand All @@ -62,10 +69,10 @@ jobs:
- uses: actions/checkout@v3

- name: Download build log
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: build-log-etc
path: tmp

- name: Check for warnings or errors in build log
run: make check-build-log;
run: scripts/check-build-log.sh
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"build:preview": "set -x && npm run _build -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"",
"build:production": "hugo --cleanDestinationDir --minify",
"build": "npm run _build",
"build+log": "npm run _build | tee tmp/build-log.txt",
"build+log": "npm run build | tee tmp/build-log.txt",
"cd:public": "cd public &&",
"check": "npm run all -- check:*",
"check:filenames": "test -z \"$(npm run -s _ls-bad-filenames)\" || npm run -s _filename-error",
Expand Down Expand Up @@ -101,7 +101,7 @@
"@opentelemetry/sdk-trace-web": "^1.8.0",
"@opentelemetry/semantic-conventions": "^1.8.0"
},
"engines-comment": "Ensure that engines.node value stays consistent with the project's .nvmrc",
"enginesComment": "Ensure that engines.node value stays consistent with the project's .nvmrc",
"engines": {
"node": "18.x"
},
Expand Down

0 comments on commit d8a9f42

Please sign in to comment.