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
151 changes: 117 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Release Desktop
name: Build and Release Latch

on:
push:
Expand All @@ -15,8 +15,43 @@ permissions:
actions: write

jobs:
prepare:
name: Validate release version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.release.outputs.version }}
tag: ${{ steps.release.outputs.tag }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Match the tag to the project version
id: release
shell: bash
run: |
version="$(sed -n 's/^latchVersion=//p' gradle.properties)"
if [[ -z "$version" ]]; then
echo "latchVersion is missing from gradle.properties" >&2
exit 1
fi

if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
tag="${GITHUB_REF_NAME}"
else
tag="v${version}"
fi

if [[ "$tag" != "v${version}" ]]; then
echo "Release tag $tag does not match latchVersion=$version" >&2
exit 1
fi

echo "version=$version" >> "$GITHUB_OUTPUT"
echo "tag=$tag" >> "$GITHUB_OUTPUT"

build-linux:
name: Build Linux Package (.tar.gz)
name: Build Linux artifacts
needs: prepare
runs-on: ubuntu-latest
steps:
- name: Checkout repo
Expand All @@ -29,20 +64,43 @@ jobs:
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build Linux .tar.gz
run: ./gradlew :desktop:packageReleaseTarGz

- name: Upload Linux Artifact
uses: actions/upload-artifact@v7
- name: Install native packaging tools
run: |
sudo apt-get update
sudo apt-get install --yes fakeroot rpm

- name: Verify shared runtime and CLI
run: |
chmod +x gradlew
./gradlew :core:desktopTest :cli:test :desktop:smoke

- name: Build Desktop and CLI packages
run: |
./gradlew \
:desktop:packageReleaseTarGz \
:cli:packageCliTarGz \
:cli:packageCliDeb \
:cli:packageCliRpm

- name: Smoke-test bundled CLI
run: |
cli/build/cli-package/image/latch-cli/bin/latch-cli --version
test "$(cli/build/cli-package/image/latch-cli/bin/latch-cli --version)" = "latch-cli ${{ needs.prepare.outputs.version }}"

- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
with:
name: linux-tarball
path: desktop/build/distributions/*.tar.gz
name: linux-artifacts
if-no-files-found: error
path: |
desktop/build/distributions/*.tar.gz
cli/build/distributions/*.tar.gz
cli/build/distributions/*.deb
cli/build/distributions/*.rpm

build-windows:
name: Build Windows Package (.msi)
name: Build Windows artifacts
needs: prepare
runs-on: windows-latest
steps:
- name: Checkout repo
Expand All @@ -55,48 +113,73 @@ jobs:
distribution: 'temurin'
cache: gradle

- name: Build Windows MSI
run: .\gradlew.bat :desktop:packageReleaseMsi
- name: Build Desktop MSI and portable CLI
run: .\gradlew.bat :desktop:packageReleaseMsi :cli:packageCliZip

- name: Upload Windows Artifact
uses: actions/upload-artifact@v7
- name: Smoke-test bundled CLI
shell: pwsh
run: |
$launcher = "cli\build\cli-package\image\latch-cli\latch-cli.exe"
$actual = & $launcher --version
if ($LASTEXITCODE -ne 0 -or $actual -ne "latch-cli ${{ needs.prepare.outputs.version }}") {
throw "Unexpected CLI version output: $actual"
}

- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: windows-msi
path: desktop/build/compose/binaries/main-release/msi/*.msi
name: windows-artifacts
if-no-files-found: error
path: |
desktop/build/compose/binaries/main-release/msi/*.msi
cli/build/distributions/*.zip

release:
name: Create GitHub Release
needs: [build-linux, build-windows]
name: Create GitHub release
needs: [prepare, build-linux, build-windows]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v8
with:
path: release-assets
merge-multiple: true

- name: Create GitHub Release
- name: Generate package-manager manifests
env:
VERSION: ${{ needs.prepare.outputs.version }}
run: |
packaging/generate-cli-package-metadata.sh \
"$VERSION" \
"release-assets/latch-cli-$VERSION-linux-x64.tar.gz" \
"release-assets/latch-cli-$VERSION-windows-x64.zip" \
package-metadata
(cd package-metadata && zip -qr "../release-assets/latch-cli-$VERSION-package-metadata.zip" .)

- name: Generate checksums
working-directory: release-assets
run: sha256sum * > SHA256SUMS

- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
tag_name: ${{ needs.prepare.outputs.tag }}
name: ${{ needs.prepare.outputs.tag }}
draft: false
prerelease: false
make_latest: true
body: |
Update checker fix.

What's New

- Fixed: the app could show "update available" even when you already had the latest version
Latch Desktop and the standalone `latch-cli` now share one release version.

Download the compatible version for your machine from the assets below.
files: |
release-assets/*
CLI downloads include portable Linux and Windows bundles, Debian and RPM packages, checksums, and submission-ready AUR/winget metadata.
files: release-assets/*

- name: Clear build artifacts storage
uses: geekyeggo/delete-artifact@v6
with:
name: |
linux-tarball
windows-msi
linux-artifacts
windows-artifacts
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Latch is a Kotlin application developed by VinnovateIT that automates the login
- Automatic detection of VIT hostel WiFi networks
- Auto-login with securely stored credentials
- Logging and display of network usage statistics
- Standalone CLI for Linux terminals and Windows PowerShell

## Prerequisites

Expand Down Expand Up @@ -55,6 +56,50 @@ Before you start, make sure you have:

To install manually instead, download `latch-1.3.8-linux-x64.tar.gz` from the [latest release](https://github.com/vinnovateit/latch/releases/latest) and extract it.

### Command-line app

`latch-cli` is a standalone application with its own trimmed Java runtime; Java does not need to be installed separately.

On Debian or Ubuntu, download the `.deb` from the [latest release](https://github.com/vinnovateit/latch/releases/latest), then run:

```sh
sudo apt install ./latch-cli_1.3.8_amd64.deb
```

RPM-based distributions can install the release package with `sudo dnf install ./latch-cli-*.rpm`. Arch users can install the `latch-cli-bin` AUR package after its release metadata is submitted. The portable `latch-cli-1.3.8-linux-x64.tar.gz` works without package-manager installation.

A hosted APT repository can be added later; the initial `.deb` is installed directly with `apt`. Flatpak is intentionally outside the CLI release scope because its sandbox and desktop-first distribution model do not fit a host-network command-line daemon.

On Windows, install `VinnovateIT.LatchCLI` with winget after its manifest is accepted, or download and extract `latch-cli-1.3.8-windows-x64.zip`. The executable works directly from PowerShell:

```powershell
.\latch-cli.exe --status
```

Run `latch-cli` with no arguments the first time. It prompts for your VIT credentials, starts the auto-login daemon in the background, and enables per-user startup at login. On later runs, `latch-cli` prints its help menu.

Use `activate` and `deactivate` to control the background daemon on Linux or from PowerShell on Windows:

```text
latch-cli activate
latch-cli deactivate
```

`activate` is idempotent and enables startup at login. `deactivate` stops a CLI-owned daemon and disables its login startup entry; it does not terminate a running desktop app. Common one-shot commands are:

```text
latch-cli --set-credentials
latch-cli --status
latch-cli --login
latch-cli --logout
latch-cli --history
latch-cli --settings
latch-cli --settings set auto-login on
latch-cli --settings set allowed-ssids "VIT2.4G,VIT5G"
```

Desktop and CLI installations can coexist. They coordinate through an authenticated local connection so only one networking engine is active, and opening Desktop takes ownership from a running CLI daemon.

### Android

No pre-built APK is currently published for the Android app. To use it today, build it from source. See [Dev setup](#dev-setup) below.
Expand Down Expand Up @@ -126,7 +171,7 @@ Optionally, it records network statistics for monitoring purposes.

- Add support for multiple VIT campuses
- Improve UI responsiveness
- CLI client ;)
- Publish the generated CLI manifests to additional package repositories

See the [open issues](https://github.com/vinnovateit/latch/issues) for a full list of proposed features and known issues.

Expand Down
Loading
Loading