Skip to content

Commit

Permalink
[Feat] support snapcraft build package to releases (#697)
Browse files Browse the repository at this point in the history
* build(snap): support snapcraft package

- add `snap/snapcraft.yaml` file

NOTE: under `devmode` until fit to release

* ci(gh-action): support `snapcraft` build and publish to `gh-release` page
  • Loading branch information
mikoloism committed Mar 10, 2024
1 parent ded2e10 commit 68500f3
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/cd.yml
Expand Up @@ -65,6 +65,9 @@ jobs:
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y --no-install-recommends liblua5.1-0-dev libluajit-5.1-dev gcc pkg-config curl git make ca-certificates
sudo apt-get install -y snapd
sudo snap install snapcraft --classic
sudo snap install multipass --classic --beta
- if: matrix.build == 'linux-musl'
run: sudo apt-get install -y musl-tools
Expand All @@ -81,6 +84,13 @@ jobs:
- name: Running cargo build
run: cargo build --locked --release --target ${{ matrix.target }}

- name: Running snapcraft build
run: |
snapcraft
printf ' [ INFO ] generated <snapcraft> files include:\n'
command ls -Al | grep "\.snap" | awk '{ print $9 }'
mv ./*.snap ./xplr.snap
- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.GPG_SECRET }}") | gpg --batch --import
Expand All @@ -103,6 +113,7 @@ jobs:
target/${{ matrix.target }}/release/xplr-${{ matrix.build }}.tar.gz
target/${{ matrix.target }}/release/xplr-${{ matrix.build }}.sha256
target/${{ matrix.target }}/release/xplr-${{ matrix.build }}.tar.gz.asc
xplr.snap
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -130,6 +141,10 @@ jobs:
source.tar.gz.asc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleaning snapcraft
run: |
command rm --verbose ./*.snap
snapcraft clean
publish-cargo:
name: Publishing to Cargo
Expand Down
26 changes: 26 additions & 0 deletions snap/snapcraft.yaml
@@ -0,0 +1,26 @@
name: xplr
version: git
summary: A hackable, minimal, fast TUI file explorer
description: |
xplr is a terminal UI based file explorer
that aims to increase our terminal productivity by being a flexible,
interactive orchestrator for the ever growing awesome command-line
utilities that work with the file-system.
source-code: https://github.com/sayanarijit/xplr
issues: https://github.com/sayanarijit/xplr/issues
website: https://xplr.dev/

base: core20
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots


parts:
xplr:
plugin: rust
source: .

apps:
xplr:
command: bin/xplr

0 comments on commit 68500f3

Please sign in to comment.