From 68500f3a8e7b315984688cba53a9e0accbe14c85 Mon Sep 17 00:00:00 2001 From: mikoloism Date: Sun, 10 Mar 2024 19:12:03 +0330 Subject: [PATCH] [Feat] support `snapcraft` build package to releases (#697) * 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 --- .github/workflows/cd.yml | 15 +++++++++++++++ snap/snapcraft.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 snap/snapcraft.yaml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8f8a80c..340733e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -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 @@ -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 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 @@ -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 }} @@ -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 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 0000000..497b6e8 --- /dev/null +++ b/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 +