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: add support for snap packages #531

Merged
merged 3 commits into from
Jan 17, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc
run: cargo build --release --locked --target ${{ matrix.target }}

- name: Build snap
if: matrix.target == 'x86_64-unknown-linux-gnu'
uses: snapcore/action-build@v1

- name: Pack artifacts [Linux & macOS]
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
env:
Expand Down Expand Up @@ -78,5 +82,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: yazi-${{ matrix.target }}.zip
files: |
yazi-${{ matrix.target }}.zip
yazi*.snap
generate_release_notes: true
33 changes: 33 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: yazi
base: core22
adopt-info: yazi
summary: Blazing fast terminal file manager written in Rust, based on async I/O.
description: |
Yazi is a terminal file manager written in Rust, based on non-blocking async I/O.
It aims to provide an efficient, user-friendly, and customizable file management experience.
license: MIT
grade: stable
confinement: classic

architectures:
- amd64
# - arm64

apps:
yazi:
command: yazi
environment:
PATH: $SNAP/bin:$PATH

parts:
yazi:
plugin: rust
source: https://github.com/sxyazi/yazi.git
override-build: |
craftctl default
craftctl set version=$(git describe --tags --abbrev=0)
cargo install fd-find --root $CRAFT_PART_INSTALL
cargo install ripgrep --root $CRAFT_PART_INSTALL
cargo install zoxide --root $CRAFT_PART_INSTALL
git clone --depth 1 https://github.com/junegunn/fzf.git fzf
fzf/install --bin && mv fzf/bin/fzf $CRAFT_PART_INSTALL/bin/