Skip to content

Commit

Permalink
chore: 减小 github action 打包体积
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieHz committed Nov 23, 2024
1 parent a7e7990 commit bdee484
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 7 deletions.
24 changes: 24 additions & 0 deletions .github/exclude-list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.git/
.github/
.husky/
.vscode/
i18n-settings
node_modules/
screenshots/
src/
tmp/
.editorconfig
.eslintrc.cjs
.gitignore
.hintrc
.prettierignore
index.html
package.json
pnpm-lock.yaml
postcss.config.js
prettier.config.js
README.md
screenshot.png
tailwind.config.js
tsconfig.json
vite.config.ts
38 changes: 31 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,42 @@ jobs:
name: Upload Theme
runs-on: ubuntu-latest
steps:
- name: Make Build Directory
run: |
pwd
mkdir -p ~/builds/tmp ~/builds/target
- name: Checkout
uses: actions/checkout@v2
- name: Zip
- name: Copy Theme Files from Original to Temp
run: |
pwd
cp -r . ~/builds/tmp
- name: Remove excluded files
run: |
mkdir -p ~/builds/target
zip -r howiehz-higan-cn.zip . -x .eslintrc.cjs .hintrc .prettierignore index.html package.json pnpm-lock.yaml postcss.config.js prettier.config.js .husky/\* src/\* i18n-settings/\* screenshots/\* .git/\* .github/\* node_modules/\* .gitignore .editorconfig .eslintignore .eslintrc.js .prettierrc.js .stylelintrc.js .vscode/\* .nuxt/\* .nuxtignore .env .env.development .env.production .env.test .env.local .env.development.local .env.production.local .env.test.local
pwd
cd ~/builds/tmp
pwd
cat ~/work/halo-theme-higan-hz/halo-theme-higan-hz/.github/exclude-list.txt | xargs rm -rvf
- name: Zip Theme in Chinese
run: |
pwd
cd ~/builds/tmp
pwd
zip -9 -r howiehz-higan-cn.zip ~/builds/tmp/*
mv howiehz-higan-cn.zip ~/builds/target
zip -r howiehz-higan-en.zip . -x .eslintrc.cjs .hintrc .prettierignore index.html package.json pnpm-lock.yaml postcss.config.js prettier.config.js .husky/\* src/\* i18n-settings/\* screenshots/\* .git/\* .github/\* node_modules/\* .gitignore .editorconfig .eslintignore .eslintrc.js .prettierrc.js .stylelintrc.js .vscode/\* .nuxt/\* .nuxtignore .env .env.development .env.production .env.test .env.local .env.development.local .env.production.local .env.test.local settings.yaml
mv howiehz-higan-en.zip ~/builds/target
- name: Zip Theme in English
run: |
pwd
cd ~/builds/tmp
pwd
rm settings.yaml
mv i18n-settings/settings.en.yaml settings.yaml
zip -r ~/builds/target/howiehz-higan-en.zip settings.yaml
zip -9 -r howiehz-higan-en.zip ~/builds/tmp/*
mv ~/work/halo-theme-higan-hz/halo-theme-higan-hz/i18n-settings/settings.en.yaml settings.yaml
zip -9 -r howiehz-higan-en.zip settings.yaml

mv howiehz-higan-en.zip ~/builds/target
- name: Upload Theme Build Target
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit bdee484

Please sign in to comment.