Add ZIP archives to Windows Releases
Modify Github Actions config to also create ZIP archives
Improve file handling in Github Actions releases
@@ -243,14 +243,23 @@ jobs:
- name: Create release assets
run: |
for d in sccache-*; do
- cp README.md LICENSE $d/
- tar -zcvf $d.tar.gz $d
- echo -n $(shasum -ba 256 $d.tar.gz | cut -d " " -f 1) > $d.tar.gz.sha256
+ cp README.md LICENSE "$d/"
+ tar -zcvf "$d.tar.gz" "$d"
+ echo -n "$(shasum -ba 256 "$d.tar.gz" | cut -d " " -f 1)" > "$d.tar.gz.sha256"
+ if [[ $d =~ (sccache-)(.*)?(x86_64-pc-windows)(.*)? ]]; then
+ zip -r "$d.zip" "$d"
+ echo -n "$(shasum -ba 256 "$d.zip" | cut -d " " -f 1)" > "$d.zip.sha256"
+ fi
done
- name: Create release
run: |
tag_name=${GITHUB_REF#refs/tags/}
- hub release create -m $tag_name $tag_name $(for f in sccache-*.tar.gz*; do echo "-a $f"; done)
+ for f in sccache-*.tar.gz* sccache-*.zip*; do
+ if [[ -f "$f" ]]; then
+ files="$files -a $f";
+ fi
+ done
+ hub release create -m $tag_name $tag_name $files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
