Skip to content

Commit

Permalink
feat: create working snap package (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
kz6fittycent authored Sep 12, 2024
1 parent 88c2445 commit a75e3e7
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/test-snap-can-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 🧪 Test snap can be built on x86_64

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2

- uses: snapcore/action-build@v1
id: build

- uses: diddlesnaps/snapcraft-review-action@v1
with:
snap: ${{ steps.build.outputs.snap }}
isClassic: 'false'
# Plugs and Slots declarations to override default denial (requires store assertion to publish)
# plugs: ./plug-declaration.json
# slots: ./slot-declaration.json
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ Available through the Arch User Repository as [jqp-bin](https://aur.archlinux.or
yay -S jqp-bin
```

### Snap install
<a href="https://snapcraft.io/jqp"><img src="https://snapcraft.io/jqp/badge.svg" alt="Snap Status"></a>

```
sudo snap install jqp
```

### GitHub releases

Download the relevant asset for your operating system from the latest GitHub release. Unpack it, then move the binary to somewhere accessible in your `PATH`, e.g. `mv ./jqp /usr/local/bin`.
Expand Down
Binary file added snap/local/jqp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: jqp
adopt-info: jqp
summary: jqp is a TUI for exploring the jq command line utility
description: |
jqp is a terminal user interface (TUI) for exploring the jq command line utility.
You can use it to run jq queries interactively. If no query is provided, the interface will prompt
you for one.
The command accepts an optional query argument which will be executed against the input JSON or
newline-delimited JSON (NDJSON).
You can provide the input JSON or NDJSON either through a file or via standard input (stdin).
Usage:
jqp [query] [flags]
Flags:
--config string path to config file (default is $HOME/.jqp.yaml)
-f, --file string path to the input JSON file
-h, --help help for jqp
-t, --theme string jqp theme
-v, --version version for jqp
license: MIT
issues: https://github.com/kz6fittycent/jqp
contact: https://github.com/kz6fittycent/jqp
source-code: https://github.com/noahgorstein/jqp
icon: snap/local/jqp.png

base: core24
grade: stable
confinement: strict
compression: lzo

platforms:
amd64:
build-on: [amd64]
build-for: [amd64]
arm64:
build-on: [arm64]
build-for: [arm64]
armhf:
build-on: [armhf]
build-for: [armhf]
ppc64el:
build-on: [ppc64el]
build-for: [ppc64el]
s390x:
build-on: [s390x]
build-for: [s390x]

apps:
jqp:
command: bin/jqp
plugs:
- home

parts:
jqp:
source: https://github.com/noahgorstein/jqp
source-type: git
plugin: go
build-snaps:
- go

override-pull: |
craftctl default
craftctl set version="$(git describe --tags | sed 's/^v//' | cut -d "-" -f1)"

0 comments on commit a75e3e7

Please sign in to comment.