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

Zip the Windows build #71

Merged
merged 3 commits into from
Dec 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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