2021-12-08 21:18:41 +00:00
|
|
|
#!/bin/bash
|
|
|
|
VERSION="$(echo ${GITHUB_REF} | sed -e 's|refs/heads/||' -e 's|refs/tags/||' -e 's|/|-|g')"
|
|
|
|
OS="${BUILD:-$(uname)}"
|
|
|
|
# Create windows installer
|
|
|
|
mkdir win
|
|
|
|
cp installer_scripts/template.iss win/win_build.iss
|
|
|
|
# adds the year and version to the inno installer
|
|
|
|
info_year=$( date "+%Y" )
|
2022-02-28 15:30:40 +00:00
|
|
|
copyright_year="#define COPYRIGHT \""${info_year}"\""
|
2021-12-08 21:18:41 +00:00
|
|
|
version_block="#define VERSION \""${VERSION}"\""
|
|
|
|
sed -i'' -e '/;inkstitch-year/ a\'$'\n'"${copyright_year}"'' win/win_build.iss
|
|
|
|
sed -i'' -e '/;inkstitch-version/ a\'$'\n'"${version_block}"'' win/win_build.iss
|
|
|
|
|
|
|
|
iscc win/win_build.iss
|
|
|
|
mv win/inkstitch.exe artifacts/inkstitch-${VERSION}-${OS}.exe
|
2022-02-28 15:30:40 +00:00
|
|
|
cd dist
|
|
|
|
echo "Creating zip"
|
|
|
|
# The python zipfile command line utility can't handle directories
|
|
|
|
# containing files with UTF-8 names on Windows, so we use 7-zip instead.
|
|
|
|
7z a ../artifacts/inkstitch-${VERSION}-${OS}.zip *
|
|
|
|
cd ..
|