Some checks failed
Research feed publisher tests / test (push) Failing after 3s
Release / Pre-flight checks (push) Failing after 0s
Release / Research Edition — patch and packaging smoke tests (push) Has been skipped
Release / Build Qt artifacts (false, 22, ubuntu-22.04, 3.9, ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }}, false, false) (push) Has been skipped
Release / Build Qt artifacts (false, 22, ubuntu-22.04, 3.9, false, false, false) (push) Has been skipped
Release / Build Qt artifacts (manylinux_2_28 — glibc 2.28 ABI floor) (22, 3.9) (push) Has been skipped
Release / Generate release notes (push) Has been skipped
Release / Create dev release tag (push) Has been skipped
CodeQL / Analyze (javascript) (push) Failing after 1s
CodeQL / Analyze (python) (push) Failing after 1s
Release / Build Qt artifacts (false, 22, windows-latest, 3.9, false, false, false) (push) Has been cancelled
Release / Build Tauri artifacts (false, 22, macos-15-intel, 3.9, false, false, false) (push) Has been cancelled
Release / Build Tauri artifacts (false, 22, macos-latest, 3.9, false, false, false) (push) Has been cancelled
Release / Build Tauri artifacts (false, 22, ubuntu-24.04, 3.9, ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }}, false, false) (push) Has been cancelled
Release / Build Tauri artifacts (false, 22, ubuntu-24.04, 3.9, false, false, false) (push) Has been cancelled
Release / Build Tauri artifacts (false, 22, ubuntu-24.04-arm, 3.9, false, false, false) (push) Has been cancelled
Release / Build Tauri artifacts (false, 22, windows-latest, 3.9, false, false, false) (push) Has been cancelled
Release / Build Qt artifacts (false, 22, macos-15-intel, 3.9, false, false, false) (push) Has been cancelled
Release / Build Qt artifacts (false, 22, macos-latest, 3.9, false, false, false) (push) Has been cancelled
Release / Publish draft release (push) Has been cancelled
124 lines
3.5 KiB
Bash
Executable File
Vendored
124 lines
3.5 KiB
Bash
Executable File
Vendored
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
echoerr() { echo "$@" 1>&2; }
|
|
|
|
function get_platform() {
|
|
# Will return "linux" for GNU/Linux
|
|
# I'd just like to interject for a moment...
|
|
# https://wiki.installgentoo.com/index.php/Interjection
|
|
# Will return "macos" for macOS/OS X
|
|
# Will return "windows" for Windows/MinGW/msys
|
|
|
|
_platform=$(uname | tr '[:upper:]' '[:lower:]')
|
|
if [[ $_platform == "darwin" ]]; then
|
|
_platform="macos";
|
|
elif [[ $_platform == "msys"* ]]; then
|
|
_platform="windows";
|
|
elif [[ $_platform == "mingw"* ]]; then
|
|
_platform="windows";
|
|
elif [[ $_platform == "linux" ]]; then
|
|
# Nothing to do
|
|
true;
|
|
else
|
|
echoerr "ERROR: $_platform is not a valid platform";
|
|
exit 1;
|
|
fi
|
|
|
|
echo $_platform;
|
|
}
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
function get_version() {
|
|
"$SCRIPT_DIR/getversion.sh";
|
|
}
|
|
|
|
function get_version_no_prefix() {
|
|
"$SCRIPT_DIR/getversion.sh" --strip-v;
|
|
}
|
|
|
|
function get_arch() {
|
|
_arch="$(uname -m)"
|
|
echo $_arch;
|
|
}
|
|
|
|
platform=$(get_platform)
|
|
version=$(get_version)
|
|
version_no_prefix=$(get_version_no_prefix)
|
|
arch=$(get_arch)
|
|
# Research tags are suffixed (e.g. v0.14.0b3-research), but the edition
|
|
# belongs in its own filename token, not in the version part:
|
|
# activitywatch[-tauri][-research]-<version>-<os>-<arch>[-setup].<ext>
|
|
version="${version%-research}"
|
|
version_no_prefix="${version_no_prefix%-research}"
|
|
build_suffix=""
|
|
if [[ $TAURI_BUILD == "true" ]]; then
|
|
build_suffix="-tauri"
|
|
fi
|
|
if [[ $AW_RESEARCH_EDITION == "true" ]]; then
|
|
build_suffix="${build_suffix}-research"
|
|
fi
|
|
|
|
echo "========================================"
|
|
echo "Build Version Information"
|
|
echo "========================================"
|
|
echo "Platform: $platform"
|
|
echo "Arch: $arch"
|
|
echo "Version (with v): $version"
|
|
echo "Version (no v): $version_no_prefix"
|
|
echo "Tauri build: ${TAURI_BUILD:-false}"
|
|
echo "========================================"
|
|
echo
|
|
|
|
# For Tauri Linux builds, include helper scripts and README
|
|
if [[ $platform == "linux" && $TAURI_BUILD == "true" ]]; then
|
|
cp scripts/package/README.txt scripts/package/move-to-aw-modules.sh dist/activitywatch/
|
|
fi
|
|
|
|
function build_zip() {
|
|
echo "Zipping executables..."
|
|
pushd dist;
|
|
filename="activitywatch${build_suffix}-${version}-${platform}-${arch}.zip"
|
|
echo "Name of package will be: $filename"
|
|
|
|
if [[ $platform == "windows"* ]]; then
|
|
7z a $filename activitywatch;
|
|
else
|
|
zip -r $filename activitywatch;
|
|
fi
|
|
popd;
|
|
echo "Zip built!"
|
|
}
|
|
|
|
function build_setup() {
|
|
filename="activitywatch${build_suffix}-${version}-${platform}-${arch}-setup.exe"
|
|
echo "Name of package will be: $filename"
|
|
|
|
innosetupdir="/c/Program Files (x86)/Inno Setup 6"
|
|
if [ ! -d "$innosetupdir" ]; then
|
|
echo "ERROR: Couldn't find innosetup which is needed to build the installer. We suggest you install it using chocolatey. Exiting."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $TAURI_BUILD == "true" ]]; then
|
|
env AW_VERSION=$version_no_prefix "$innosetupdir/iscc.exe" scripts/package/aw-tauri.iss
|
|
else
|
|
env AW_VERSION=$version_no_prefix "$innosetupdir/iscc.exe" scripts/package/activitywatch-setup.iss
|
|
fi
|
|
"$SCRIPT_DIR/collect-setup.sh" "$filename"
|
|
echo "Setup built!"
|
|
}
|
|
|
|
build_zip
|
|
if [[ $platform == "windows"* ]]; then
|
|
build_setup
|
|
fi
|
|
|
|
echo
|
|
echo "-------------------------------------"
|
|
echo "Contents of ./dist"
|
|
ls -l dist
|
|
echo "-------------------------------------"
|