Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Commit

Permalink
Zip the Windows build (#71)
Browse files Browse the repository at this point in the history
* Zip for Windows releases, tar for other platforms

Also renamed release_tar variable to release_archive to avoid confusion

* Windows builder doesn't have zip, it has 7za

* 7z instead of 7za...
  • Loading branch information
moppius authored and mergify[bot] committed Dec 2, 2019
1 parent 7196f75 commit c24cc38
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,13 @@ jobs:
name=texture-synthesis
tag=$(git describe --tags --abbrev=0)
release_name="$name-$tag-${{ matrix.target }}"
release_tar="${release_name}.tar.gz"
# Archive in .zip for Windows, .tar.gz for other platforms
if [ "${{ matrix.os }}" == "windows-latest" ]; then
release_archive="${release_name}.zip"
else
release_archive="${release_name}.tar.gz"
fi
mkdir "$release_name"
if [ "${{ matrix.target }}" != "x86_64-pc-windows-msvc" ]; then
Expand All @@ -206,16 +212,22 @@ jobs:
cp "target/${{ matrix.target }}/release/${{ matrix.bin }}" "$release_name/"
cp README.md LICENSE-APACHE LICENSE-MIT "$release_name/"
tar czvf "$release_tar" "$release_name"
# Archive in .zip for Windows, .tar.gz for other platforms
if [ "${{ matrix.os }}" == "windows-latest" ]; then
7z a "$release_archive" "$release_name"
else
tar czvf "$release_archive" "$release_name"
fi
rm -r "$release_name"
# Windows environments in github actions don't have the gnu coreutils installed,
# which includes the shasum exe, so we just use powershell instead
if [ "${{ matrix.os }}" == "windows-latest" ]; then
echo "(Get-FileHash \"${release_tar}\" -Algorithm SHA256).Hash | Out-File -Encoding ASCII -NoNewline \"${release_tar}.sha256\"" | pwsh -c -
echo "(Get-FileHash \"${release_archive}\" -Algorithm SHA256).Hash | Out-File -Encoding ASCII -NoNewline \"${release_archive}.sha256\"" | pwsh -c -
else
echo -n "$(shasum -ba 256 "${release_tar}" | cut -d " " -f 1)" > "${release_tar}.sha256"
echo -n "$(shasum -ba 256 "${release_archive}" | cut -d " " -f 1)" > "${release_archive}.sha256"
fi
- name: Publish
uses: softprops/action-gh-release@v1
Expand Down

0 comments on commit c24cc38

Please sign in to comment.