Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] support snapcraft build package to releases #697

Merged
merged 2 commits into from Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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