From ffe3202d4dccc770c02a19f5a20da8523a705646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bir=C3=B3=2C=20Csaba=20Attila?= Date: Thu, 16 Apr 2026 14:05:47 +0200 Subject: [PATCH] ci: add Snap package publishing for Ubuntu/Linux Add snapcraft.yaml and GitHub Actions workflow to build and publish to the Snap Store on release. Closes #162 --- .github/workflows/snap.yml | 23 +++++++++++++++++++++++ snap/snapcraft.yaml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/snap.yml create mode 100644 snap/snapcraft.yaml diff --git a/.github/workflows/snap.yml b/.github/workflows/snap.yml new file mode 100644 index 0000000..6222313 --- /dev/null +++ b/.github/workflows/snap.yml @@ -0,0 +1,23 @@ +name: Publish to Snap Store + +on: + release: + types: [released] + +jobs: + snap: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - uses: snapcore/action-build@v1 + id: build + + - uses: snapcore/action-publish@v1 + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} + with: + snap: ${{ steps.build.outputs.snap }} + release: stable diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 0000000..5d4886a --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,32 @@ +name: copia-cli +version: git +summary: CLI for Copia — source control for industrial automation +description: | + copia-cli brings Copia repositories, issues, pull requests, and other + concepts to the terminal next to where you are already working with + git and your code. + +base: core24 +grade: stable +confinement: classic +license: AGPL-3.0 + +platforms: + amd64: + arm64: + +parts: + copia-cli: + plugin: go + source: . + source-type: local + build-snaps: + - go/1.26/stable + go-buildtags: [] + go-generate: [] + override-build: | + go build -ldflags "-s -w -X github.com/qubernetic/copia-cli/internal/build.Version=$(git describe --tags --always) -X github.com/qubernetic/copia-cli/internal/build.Date=$(date -u +%Y-%m-%d)" -o $CRAFT_PART_INSTALL/bin/copia-cli ./cmd/copia-cli + +apps: + copia-cli: + command: bin/copia-cli