Skip to content

Commit

Permalink
Merge branch 'master' into cd/rename-hash-file
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/zip-vpm.yml
  • Loading branch information
KisaragiEffective committed Nov 13, 2024
2 parents be85443 + 7ae647a commit 14e7d5f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/zip-vpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,30 @@ 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.sha256sum
shell: pwsh
- name: Upload files
run: |
gh release upload ${{github.event.release.tag_name}} vpm-src.zip
gh release upload ${{github.event.release.tag_name}} vpm-src.zip.sha256sum
env:
GH_TOKEN: ${{ github.token }}

0 comments on commit 14e7d5f

Please sign in to comment.