Skip to content

Commit

Permalink
更新打包
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Aug 2, 2024
1 parent 3178cd7 commit 23bfbc0
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 47 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ jobs:
name: replace-google-cdn-v3-chromium
retention-days: 7
path: |
dist/v3/ReplaceGoogleCDN-chromium.zip
dist/ReplaceGoogleCDN-v3-chromium.zip
- name: production artifacts v3 firefox
uses: actions/upload-artifact@v4
with:
name: replace-google-cdn-v3-firefox
retention-days: 7
path: |
dist/v3/ReplaceGoogleCDN-firefox.zip
dist/ReplaceGoogleCDN-v3-firefox.zip
- name: Release
uses: softprops/[email protected]
Expand All @@ -72,8 +72,8 @@ jobs:
files: |
dist/ReplaceGoogleCDN-v2.zip
dist/ReplaceGoogleCDN-v3.zip
dist/v3/ReplaceGoogleCDN-chromium.zip
dist/v3/ReplaceGoogleCDN-firefox.zip
dist/ReplaceGoogleCDN-v3-chromium.zip
dist/ReplaceGoogleCDN-v3-firefox.zip
- name: Browser Plugin Publish v2
if: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
path: |
${{ github.workspace }}/var/chrome-mac.zip
${{ github.workspace }}/var/chrome-mac
key: ${{ runner.os }}-x86_64-chromium
key: ${{ runner.os }}-aarch64-chromium

- name: Download Chromium
run: |
Expand Down
44 changes: 21 additions & 23 deletions release-archive-v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ __PROJECT__=${__DIR__}
cd ${__PROJECT__}

mkdir -p ${__PROJECT__}/var/
mkdir -p ${__PROJECT__}/dist/v3/
mkdir -p ${__PROJECT__}/dist/



## 打包 chromium 扩展

test -f ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-chromium.zip && rm -f ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-chromium.zip
test -f ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-chromium.zip && rm -f ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-chromium.zip

cd ${__PROJECT__}

test -d ${__PROJECT__}/extension/_metadata && rm -rf ${__PROJECT__}/extension/_metadata

cd ${__PROJECT__}/extension
# 打包 manifest v3 支持chromium 内核系列
zip -r ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-chromium.zip . \
zip -r ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-chromium.zip . \
-x ".git/*" \
-x ".idea/*" \
-x "_metadata/*" \
Expand All @@ -45,16 +45,16 @@ zip -r ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-chromium.zip . \
cd ${__PROJECT__}


zip -u ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-chromium.zip ./README.md
zip -u ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-chromium.zip ./Privacy.md
zip -u ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-chromium.zip ./LICENSE
zip -u ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-chromium.zip ./README.md
zip -u ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-chromium.zip ./Privacy.md
zip -u ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-chromium.zip ./LICENSE




## 打包 firefox 扩展

test -f ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-firefox.zip && rm -f ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-firefox.zip
test -f ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-firefox.zip && rm -f ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-firefox.zip

test -d ${__PROJECT__}/var/extension-tmp/ && rm -rf ${__PROJECT__}/var/extension-tmp/

Expand All @@ -75,31 +75,29 @@ python3 tools/update-v3-manifest.py firefox


cd ${__PROJECT__}/var/extension-tmp/
zip -r ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-firefox.zip .
zip -r ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-firefox.zip .

cd ${__PROJECT__}/

zip -u ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-firefox.zip ./README.md
zip -u ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-firefox.zip ./Privacy.md
zip -u ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-firefox.zip ./LICENSE
zip -u ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-firefox.zip ./README.md
zip -u ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-firefox.zip ./Privacy.md
zip -u ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-firefox.zip ./LICENSE


# 为了兼容 上一版的打包结果
cp -f ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-chromium.zip ${__PROJECT__}/dist/ReplaceGoogleCDN-v3.zip

# 查看打包结果
cd ${__PROJECT__}/dist/v3/

test -d ReplaceGoogleCDN-chromium && rm -rf ReplaceGoogleCDN-chromium
test -d ReplaceGoogleCDN-firefox && rm -rf ReplaceGoogleCDN-firefox

unzip ReplaceGoogleCDN-chromium.zip -d ReplaceGoogleCDN-chromium
unzip ReplaceGoogleCDN-firefox.zip -d ReplaceGoogleCDN-firefox

cd ${__PROJECT__}
# 查看打包结果
cd ${__PROJECT__}/dist/

test -d ReplaceGoogleCDN-v3-chromium && rm -rf ReplaceGoogleCDN-v3-chromium
unzip ReplaceGoogleCDN-v3-chromium.zip -d ReplaceGoogleCDN-v3-chromium

# 为了兼容 上一版的打包结果
cp -f ${__PROJECT__}/dist/v3/ReplaceGoogleCDN-chromium.zip ${__PROJECT__}/dist/ReplaceGoogleCDN-v3.zip
test -d ReplaceGoogleCDN-v3-firefox && rm -rf ReplaceGoogleCDN-v3-firefox
unzip ReplaceGoogleCDN-v3-firefox.zip -d ReplaceGoogleCDN-v3-firefox

cd ${__PROJECT__}/dist/
test -d ReplaceGoogleCDN-v3 && rm -rf ReplaceGoogleCDN-v3
unzip ReplaceGoogleCDN-v3.zip -d ReplaceGoogleCDN-v3

cd ${__PROJECT__}
28 changes: 9 additions & 19 deletions release-archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ __PROJECT__=${__DIR__}
cd ${__PROJECT__}

mkdir -p ${__PROJECT__}/var/
mkdir -p ${__PROJECT__}/dist/v2/
mkdir -p ${__PROJECT__}/dist/

test -f ${__PROJECT__}/dist/v2/ReplaceGoogleCDN.zip && rm -f ${__PROJECT__}/dist/v2/ReplaceGoogleCDN.zip
test -f ${__PROJECT__}/dist/ReplaceGoogleCDN-v2.zip && rm -f ${__PROJECT__}/dist/ReplaceGoogleCDN-v2.zip

# 打包 manifest v2 支持chromium 内核系列 和 firefox
cd ${__PROJECT__}/extension-v2/

zip -r ${__PROJECT__}/dist/v2/ReplaceGoogleCDN.zip . \
zip -r ${__PROJECT__}/dist/ReplaceGoogleCDN-v2.zip . \
-x ".git/*" \
-x ".idea/*" \
-x "_metadata/*" \
Expand All @@ -28,25 +28,15 @@ zip -r ${__PROJECT__}/dist/v2/ReplaceGoogleCDN.zip . \
-x "./test/*"

cd ${__PROJECT__}
zip -u dist/v2/ReplaceGoogleCDN.zip ./README.md
zip -u dist/v2/ReplaceGoogleCDN.zip ./Privacy.md
zip -u dist/v2/ReplaceGoogleCDN.zip ./LICENSE
zip -u dist/ReplaceGoogleCDN-v2.zip ./README.md
zip -u dist/ReplaceGoogleCDN-v2.zip ./Privacy.md
zip -u dist/ReplaceGoogleCDN-v2.zip ./LICENSE

cd ${__PROJECT__}/dist/v2/
cd ${__PROJECT__}/dist/
# 查看打包结果

test -d ReplaceGoogleCDN && rm -rf ReplaceGoogleCDN
test -d ReplaceGoogleCDN-v2 && rm -rf ReplaceGoogleCDN-v2

unzip ReplaceGoogleCDN.zip -d ReplaceGoogleCDN
unzip ReplaceGoogleCDN-v2.zip -d ReplaceGoogleCDN-v2

cd ${__PROJECT__}




# 为了兼容 上一版的打包结果
cp -f ${__PROJECT__}/dist/v2/ReplaceGoogleCDN.zip ${__PROJECT__}/dist/ReplaceGoogleCDN-v2.zip

cd ${__PROJECT__}/dist/
test -d ReplaceGoogleCDN-v2 && rm -rf ReplaceGoogleCDN-v2
unzip ReplaceGoogleCDN-v2.zip -d ReplaceGoogleCDN-v2

0 comments on commit 23bfbc0

Please sign in to comment.