Skip to content

Commit

Permalink
Merge pull request #208 from KisaragiEffective/cd/optimize-zip-archiv…
Browse files Browse the repository at this point in the history
…e-size
KisaragiEffective authored Nov 13, 2024
2 parents 48807f4 + a6ab6e6 commit 7ae647a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/zip-vpm.yml
Original file line number Diff line number Diff line change
@@ -15,11 +15,25 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Add commit hash to the manifest
run: |
# moreutils はおそらく追加されない上インストールすると遅いので使わない
# see also: https://github.com/actions/runner-images/issues/5498
jq --arg hash "$(git rev-parse HEAD)" '.version += ("+git." + $hash)' < package.json > package.json.tmp
mv package.json.tmp package.json
- name: Zip
run: |
zip -r vpm-src.zip .
# git のコミット履歴、GitHub用のファイル、Krita、Microsoft.Unity.AnalyzersはVPMパッケージのユーザーにとっては要らない。
# そのためvpm-src.zipから除外する。
zip -r vpm-src.zip . \
--exclude '.git/**' \
--exclude 'Doc~/Original/*' \
--exclude 'Editor/0Analyzer/Microsoft.Unity.Analyzers.*' \
--exclude '.github/**'
- name: Compute SHA256
run: |
# sha256sumを使うと加工が非直感的だし、ここでスクリプト言語や外部バイナリを持ち出すと遅い。
# PowerShell Coreを起動して回避。
echo (Get-FileHash ./vpm-src.zip -Algorithm SHA256).Hash > vpm-src.zip.sha256
shell: pwsh
- name: Upload files

0 comments on commit 7ae647a

Please sign in to comment.