From 312ee445b371c7cb30e9e9f97ebce5137c93eafb Mon Sep 17 00:00:00 2001 From: Andrei Gherzan Date: Mon, 6 Jul 2026 21:42:52 +0100 Subject: [PATCH] build: add snap packaging support Allows gitlance to be distributed via the Snap Store. Signed-off-by: Andrei Gherzan --- .gitignore | 3 +++ README.md | 10 ++++++++++ snap/snapcraft.yaml | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 snap/snapcraft.yaml diff --git a/.gitignore b/.gitignore index cd8c4c0..aab0cbd 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ # Coverage reports /coverage/ + +# Snap build artifacts +*.snap diff --git a/README.md b/README.md index 570159f..429d742 100644 --- a/README.md +++ b/README.md @@ -219,10 +219,20 @@ steps: ## Installation +### GitHub Action + The action automatically downloads the pre-built binary for the specified version. No additional setup is required. **Note:** Prebuilt binaries are only available for immutable release tags (e.g., `@v1.2.3`). Major tags like `@v1` will build from source on each run. +### Snap Package + +Install from the Snap Store: + +```bash +sudo snap install gitlance +``` + ## Building Locally ### Using Task diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 0000000..d6f429f --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: Canonical Ltd. +# +# SPDX-License-Identifier: Apache-2.0 + +name: gitlance +base: core24 +version: git +summary: Vigilance for your Git commits +description: | + A tool for validating Git commit messages. + +title: gitlance +contact: https://github.com/canonical/gitlance/issues +issues: https://github.com/canonical/gitlance/issues +source-code: https://github.com/canonical/gitlance +website: https://github.com/canonical/gitlance + +grade: stable +confinement: strict +license: Apache-2.0 + +platforms: + amd64: + +apps: + gitlance: + command: bin/gitlance + plugs: + - home + +parts: + gitlance: + plugin: rust + source: . + rust-channel: stable + build-packages: + # Required by git2 crate's libgit2-sys dependency + - pkg-config + - libssl-dev