Skip to content

Commit

Permalink
Refactor scripts and cache dist
Browse files Browse the repository at this point in the history
  • Loading branch information
northword committed Sep 12, 2024
1 parent 963a107 commit f01002b
Show file tree
Hide file tree
Showing 17 changed files with 407 additions and 512 deletions.
14 changes: 5 additions & 9 deletions .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@ set -e

dist="dist"

# 清除先前构建
if [ -d "$dist" ]; then
rm -rf "$dist"
fi
mkdir $dist

# 获取数据
pnpm run data:info
pnpm run data:chart

# 复制兼容性网页
mkdir $dist/dist
mv $dist/*.json $dist/xpi $dist/dist -f
# 复制兼容性文件
if [ ! -d "$dist/dist" ]; then
mkdir $dist/dist
fi
cp $dist/*.json $dist/dist
cp .github/scripts/index.html $dist
cp .github/scripts/_redirects $dist
touch $dist/.nojekyll
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ jobs:
- name: Install deps
run: pnpm install

- name: Cache dist
uses: actions/cache@v3
env:
cache-name: cache-dist
with:
path: dist
key: ${{ env.cache-name }}-${{ hashFiles('dist/plugins.json') }}

- name: Build
env:
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB_TOKEN_NORTHWORD_GHOST }}
Expand Down
8 changes: 1 addition & 7 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
import antfu from '@antfu/eslint-config'

export default antfu({
javascript: {
overrides: {
'no-console': 'off',
},
},
})
export default antfu()
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@
"@antfu/eslint-config": "^2.26.0",
"@highcharts/dashboards": "2.3.0",
"@types/adm-zip": "0.5.5",
"@types/fs-extra": "^11.0.4",
"@types/node": "20.16.2",
"@types/xml2js": "0.4.14",
"@vitalets/google-translate-api": "9.2.0",
"adm-zip": "0.5.16",
"consola": "^3.2.3",
"cross-env": "7.0.3",
"es-toolkit": "^1.17.0",
"eslint": "9.9.1",
"franc-min": "6.2.0",
"google-translate-api-x": "10.7.1",
"fs-extra": "^11.2.0",
"globby": "^14.0.2",
"highcharts": "11.4.8",
"husky": "9.1.5",
"jsonc": "2.0.0",
"lint-staged": "15.2.9",
"npm-run-all2": "6.2.2",
"octokit": "4.0.2",
"tsx": "4.19.0",
"typescript": "5.5.4",
"xml2js": "0.6.2"
"typescript": "5.5.4"
},
"lint-staged": {
"*.*": "eslint --fix"
Expand Down
Loading

0 comments on commit f01002b

Please sign in to comment.