Skip to content
Merged
Show file tree
Hide file tree
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
112 changes: 90 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ jobs:
- name: Determine and output version
run: |
VERSION_WITH_V=$(bash scripts/package/getversion.sh)
# Strip the research tag suffix for filenames: the edition gets its
# own token (activitywatch[-tauri][-research]-<version>-...), so the
# version part stays a plain version.
VERSION_WITH_V="${VERSION_WITH_V%-research}"
VERSION_NO_V="${VERSION_WITH_V#v}"
echo "VERSION_WITH_V=${VERSION_WITH_V}" >> "$GITHUB_ENV"
echo "========================================"
Expand All @@ -305,6 +309,41 @@ jobs:
echo "Version (no v): ${VERSION_NO_V}"
echo "========================================"

- name: Verify aw-server-rust submodule version matches release tag
if: startsWith(github.ref, 'refs/tags/v')
run: |
# Fail fast if the aw-server-rust submodule is pinned to an older
# release line than the one we're tagging. The Windows 0.14 Tauri
# bundle shipped with aw-server-rust v0.13.1 (activitywatch#1380);
# catch the same class of mismatch here before spending ~30 min on a
# full Tauri build.
#
# The bundled binary's version lives in
# aw-server-rust/aw-server/Cargo.toml (the workspace-level
# aw-server-rust/Cargo.toml has no [package].version field).
BUNDLED_VERSION=$(grep -m1 '^version = ' aw-server-rust/aw-server/Cargo.toml | sed -E 's/^version = "(.*)".*/\1/')
if [ -z "$BUNDLED_VERSION" ]; then
echo "ERROR: could not read aw-server version from aw-server-rust/aw-server/Cargo.toml" >&2
exit 1
fi

AW_VERSION="${VERSION_NO_V}" # e.g. "0.14.0b3"
AW_MAJOR_MINOR=$(echo "$AW_VERSION" | cut -d'.' -f1-2) # "0.14"
AWS_MAJOR_MINOR=$(echo "$BUNDLED_VERSION" | cut -d'.' -f1-2) # "0.14"

echo "AW release tag: ${AW_VERSION} (major.minor: ${AW_MAJOR_MINOR})"
echo "Bundled aw-server: ${BUNDLED_VERSION} (major.minor: ${AWS_MAJOR_MINOR})"

if [ "$AW_MAJOR_MINOR" != "$AWS_MAJOR_MINOR" ]; then
echo ""
echo "ERROR: aw-server-rust major.minor (${AWS_MAJOR_MINOR}) does not match"
echo " AW release major.minor (${AW_MAJOR_MINOR})."
echo " The aw-server-rust submodule is stale for this tag."
echo " Update the submodule (cd aw-server-rust && git pull) and re-tag."
exit 1
fi
echo "OK: aw-server version ${BUNDLED_VERSION} is consistent with AW release ${AW_VERSION}"

- name: Set up Python
uses: actions/setup-python@v6
with:
Expand Down Expand Up @@ -437,9 +476,9 @@ jobs:

make dist/notarize
fi
EDITION_SUFFIX=""
if [[ "$AW_RESEARCH_EDITION" == "true" ]]; then EDITION_SUFFIX="-research-edition"; fi
mv dist/ActivityWatch.dmg dist/activitywatch-${VERSION_WITH_V}-macos-$(uname -m)${EDITION_SUFFIX}.dmg
EDITION=""
if [[ "$AW_RESEARCH_EDITION" == "true" ]]; then EDITION="-research"; fi
mv dist/ActivityWatch.dmg dist/activitywatch${EDITION}-${VERSION_WITH_V}-macos-$(uname -m).dmg
env:
APPLE_EMAIL: ${{ secrets.APPLE_EMAIL }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
Expand All @@ -450,21 +489,11 @@ jobs:

- name: Package AppImage
if: startsWith(runner.os, 'linux')
run: |
./scripts/package/package-appimage.sh
if [[ "$AW_RESEARCH_EDITION" == "true" ]]; then
mv dist/activitywatch-linux-x86_64.AppImage \
dist/activitywatch-linux-x86_64-research-edition.AppImage
fi
run: ./scripts/package/package-appimage.sh

- name: Package deb
if: startsWith(runner.os, 'linux')
run: |
./scripts/package/package-deb.sh
if [[ "$AW_RESEARCH_EDITION" == "true" ]]; then
deb="dist/activitywatch-${VERSION_WITH_V}-linux-x86_64.deb"
mv "$deb" "${deb%.deb}-research-edition.deb"
fi
run: ./scripts/package/package-deb.sh

- name: Upload packages
uses: actions/upload-artifact@v7
Expand Down Expand Up @@ -525,6 +554,10 @@ jobs:
- name: Determine and output version
run: |
VERSION_WITH_V=$(bash scripts/package/getversion.sh)
# Strip the research tag suffix for filenames: the edition gets its
# own token (activitywatch[-tauri][-research]-<version>-...), so the
# version part stays a plain version.
VERSION_WITH_V="${VERSION_WITH_V%-research}"
VERSION_NO_V="${VERSION_WITH_V#v}"
echo "VERSION_WITH_V=${VERSION_WITH_V}" >> "$GITHUB_ENV"
echo "========================================"
Expand All @@ -536,6 +569,41 @@ jobs:
echo "Version (no v): ${VERSION_NO_V}"
echo "========================================"

- name: Verify aw-server-rust submodule version matches release tag
if: startsWith(github.ref, 'refs/tags/v')
run: |
# Fail fast if the aw-server-rust submodule is pinned to an older
# release line than the one we're tagging. The Windows 0.14 Tauri
# bundle shipped with aw-server-rust v0.13.1 (activitywatch#1380);
# catch the same class of mismatch here before spending ~30 min on a
# full Tauri build.
#
# The bundled binary's version lives in
# aw-server-rust/aw-server/Cargo.toml (the workspace-level
# aw-server-rust/Cargo.toml has no [package].version field).
BUNDLED_VERSION=$(grep -m1 '^version = ' aw-server-rust/aw-server/Cargo.toml | sed -E 's/^version = "(.*)".*/\1/')
if [ -z "$BUNDLED_VERSION" ]; then
echo "ERROR: could not read aw-server version from aw-server-rust/aw-server/Cargo.toml" >&2
exit 1
fi

AW_VERSION="${VERSION_NO_V}" # e.g. "0.14.0b3"
AW_MAJOR_MINOR=$(echo "$AW_VERSION" | cut -d'.' -f1-2) # "0.14"
AWS_MAJOR_MINOR=$(echo "$BUNDLED_VERSION" | cut -d'.' -f1-2) # "0.14"

echo "AW release tag: ${AW_VERSION} (major.minor: ${AW_MAJOR_MINOR})"
echo "Bundled aw-server: ${BUNDLED_VERSION} (major.minor: ${AWS_MAJOR_MINOR})"

if [ "$AW_MAJOR_MINOR" != "$AWS_MAJOR_MINOR" ]; then
echo ""
echo "ERROR: aw-server-rust major.minor (${AWS_MAJOR_MINOR}) does not match"
echo " AW release major.minor (${AW_MAJOR_MINOR})."
echo " The aw-server-rust submodule is stale for this tag."
echo " Update the submodule (cd aw-server-rust && git pull) and re-tag."
exit 1
fi
echo "OK: aw-server version ${BUNDLED_VERSION} is consistent with AW release ${AW_VERSION}"

- name: Set up Python
uses: actions/setup-python@v6
with:
Expand Down Expand Up @@ -669,13 +737,13 @@ jobs:
# `dist/activitywatch-*.*` upload pattern below.
ARCH=$(uname -m)
shopt -s nullglob
EDITION_SUFFIX=""
if [[ "$AW_RESEARCH_EDITION" == "true" ]]; then EDITION_SUFFIX="-research-edition"; fi
EDITION=""
if [[ "$AW_RESEARCH_EDITION" == "true" ]]; then EDITION="-research"; fi
for ext in AppImage deb rpm; do
files=( dist/activitywatch/aw-tauri/*.${ext} )
case ${#files[@]} in
0) continue ;;
1) cp -v "${files[0]}" "dist/activitywatch-tauri-${VERSION_WITH_V}-linux-${ARCH}${EDITION_SUFFIX}.${ext}" ;;
1) cp -v "${files[0]}" "dist/activitywatch-tauri${EDITION}-${VERSION_WITH_V}-linux-${ARCH}.${ext}" ;;
*) echo "ERROR: expected at most 1 .${ext} bundle, found ${#files[@]}" >&2; exit 1 ;;
esac
done
Expand All @@ -700,9 +768,9 @@ jobs:

make dist/notarize
fi
EDITION_SUFFIX=""
if [[ "$AW_RESEARCH_EDITION" == "true" ]]; then EDITION_SUFFIX="-research-edition"; fi
mv dist/ActivityWatch.dmg dist/activitywatch-tauri-${VERSION_WITH_V}-macos-$(uname -m)${EDITION_SUFFIX}.dmg
EDITION=""
if [[ "$AW_RESEARCH_EDITION" == "true" ]]; then EDITION="-research"; fi
mv dist/ActivityWatch.dmg dist/activitywatch-tauri${EDITION}-${VERSION_WITH_V}-macos-$(uname -m).dmg
env:
APPLE_EMAIL: ${{ secrets.APPLE_EMAIL }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
Expand Down Expand Up @@ -784,7 +852,7 @@ jobs:
mv release_notes_research.md release_notes.md
# The generated Downloads section hardcodes standard-edition asset
# filenames, which do not exist on research releases (research
# artifacts carry a research-edition suffix). Point at the asset
# artifacts carry a -research token). Point at the asset
# list instead of linking to 404s.
python3 - <<'PY'
import re
Expand Down
7 changes: 6 additions & 1 deletion scripts/package/package-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,17 @@ 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-edition"
build_suffix="${build_suffix}-research"
fi

echo "========================================"
Expand Down
9 changes: 8 additions & 1 deletion scripts/package/package-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ chmod a+x ./activitywatch/AppRun
# build appimage
./linuxdeploy-x86_64.AppImage --appdir activitywatch --executable ./activitywatch/aw-qt --output appimage --desktop-file ./activitywatch/aw-qt.desktop --icon-file ./activitywatch/media/logo/logo.png --icon-filename activitywatch
APPIMAGE_FILE=`ls -1 | grep AppImage| grep -i ActivityWatch`
cp -v $APPIMAGE_FILE ./dist/activitywatch-linux-x86_64.AppImage
# Deliberately unversioned: the AppImage has kept this exact name across
# releases so the stable download URL keeps working, e.g.
# https://github.com/ActivityWatch/activitywatch/releases/latest/download/activitywatch-linux-x86_64.AppImage
EDITION=""
if [[ $AW_RESEARCH_EDITION == "true" ]]; then
EDITION="-research"
fi
cp -v $APPIMAGE_FILE ./dist/activitywatch${EDITION}-linux-x86_64.AppImage
9 changes: 8 additions & 1 deletion scripts/package/package-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ set -x

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VERSION="$("$SCRIPT_DIR/getversion.sh")"
# Strip the research tag suffix: the edition gets its own filename token, and
# a bare "-research" in the Debian version field would parse as a revision.
VERSION="${VERSION%-research}"
VERSION_NUM="$(echo "$VERSION" | sed -e 's/^v//')"
EDITION=""
if [[ $AW_RESEARCH_EDITION == "true" ]]; then
EDITION="-research"
fi
echo "Version (with v): $VERSION"
echo "Version (without v): $VERSION_NUM"
PKGDIR="activitywatch_$VERSION_NUM"
Expand Down Expand Up @@ -51,4 +58,4 @@ sudo cp $PKGDIR/opt/activitywatch/aw-qt.desktop $PKGDIR/etc/xdg/autostart/
sudo cp $PKGDIR/opt/activitywatch/aw-qt.desktop $PKGDIR/usr/share/applications/

dpkg-deb --build $PKGDIR
sudo mv activitywatch_${VERSION_NUM}.deb dist/activitywatch-${VERSION}-linux-x86_64.deb
sudo mv activitywatch_${VERSION_NUM}.deb dist/activitywatch${EDITION}-${VERSION}-linux-x86_64.deb
Loading