From 283f9377f27202c9dc4496774b6b7866ca4b7677 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 21 Oct 2023 13:27:26 +0800 Subject: [PATCH] chore: release --- .github/workflows/release.yml | 44 ++++++++++++++++++----------- .github/workflows/test.yml | 20 ++++++------- cspell.json | 2 +- plugin/preset/components/folder.lua | 4 ++- 4 files changed, 41 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 48b969caf..a89e66dd2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,8 +6,10 @@ on: - "v[0-9]+.[0-9]+.[0-9]+" jobs: - publish: - runs-on: ${{ matrix.os }} + release: + permissions: + contents: write + strategy: matrix: include: @@ -20,39 +22,47 @@ jobs: - os: macos-latest target: aarch64-apple-darwin + runs-on: ${{ matrix.os }} + steps: - uses: actions/checkout@v3 - - name: Cache Dependencies + - name: Add aarch64 target + if: matrix.target == 'aarch64-apple-darwin' + run: rustup target add aarch64-apple-darwin + + - name: Cache dependencies uses: Swatinem/rust-cache@v2 - name: Build run: cargo build --release --locked --target ${{ matrix.target }} - - name: Pack Artifacts [Linux & macOS] + - name: Pack artifacts [Linux & macOS] if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' env: - RELEASE_NAME: yazi-${{ matrix.target }} + TARGET_NAME: yazi-${{ matrix.target }} run: | - mkdir $RELEASE_NAME - cp target/${{ matrix.target }}/release/yazi $RELEASE_NAME - cp -r config/completions $RELEASE_NAME - cp README.md LICENSE $RELEASE_NAME - zip -r $RELEASE_NAME.zip $RELEASE_NAME + mkdir $TARGET_NAME + cp target/${{ matrix.target }}/release/yazi $TARGET_NAME + cp -r config/completions $TARGET_NAME + cp README.md LICENSE $TARGET_NAME + zip -r $TARGET_NAME.zip $TARGET_NAME - - name: Pack Artifacts [Windows] + - name: Pack artifacts [Windows] if: matrix.os == 'windows-latest' env: - RELEASE_NAME: yazi-${{ matrix.target }} + TARGET_NAME: yazi-${{ matrix.target }} run: | - New-Item -ItemType Directory -Path ${env:RELEASE_NAME} - Copy-Item -Path "target\${{ matrix.target }}\release\yazi.exe" -Destination ${env:RELEASE_NAME} - Copy-Item -Path "config\completions" -Destination ${env:RELEASE_NAME} -Recurse - Copy-Item -Path "README.md", "LICENSE" -Destination ${env:RELEASE_NAME} - Compress-Archive -Path ${env:RELEASE_NAME} -DestinationPath "${env:RELEASE_NAME}.zip" + New-Item -ItemType Directory -Path ${env:TARGET_NAME} + Copy-Item -Path "target\${{ matrix.target }}\release\yazi.exe" -Destination ${env:TARGET_NAME} + Copy-Item -Path "config\completions" -Destination ${env:TARGET_NAME} -Recurse + Copy-Item -Path "README.md", "LICENSE" -Destination ${env:TARGET_NAME} + Compress-Archive -Path ${env:TARGET_NAME} -DestinationPath "${env:TARGET_NAME}.zip" - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: + draft: true files: yazi-${{ matrix.target }}.zip + generate_release_notes: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5ab1ad3ac..09de2723e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,21 +10,21 @@ env: CARGO_TERM_COLOR: always jobs: - build: + test: strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Cache Dependencies - uses: Swatinem/rust-cache@v2 + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 - - name: Build - run: cargo build --verbose + - name: Build + run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + - name: Run tests + run: cargo test --verbose diff --git a/cspell.json b/cspell.json index 1ca7c89d5..0138e4fca 100644 --- a/cspell.json +++ b/cspell.json @@ -1 +1 @@ -{"version":"0.2","language":"en","words":["Punct","KEYMAP","splitn","crossterm","YAZI","unar","peekable","ratatui","syntect","pbpaste","pbcopy","ffmpegthumbnailer","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","nvim","indexmap","indexmap","unwatch","canonicalize","serde","fsevent","Ueberzug","iterm","wezterm","sixel","chafa","ueberzugpp","️ Überzug","️ Überzug","Konsole","Alacritty","Überzug","pkgs","paru","unarchiver","pdftoppm","poppler","prebuild","singlefile","jpegopt","EXIF","rustfmt","mktemp","nanos","xclip","xsel","natord","Mintty","nixos","nixpkgs","SIGTSTP","SIGCONT","SIGCONT","mlua","nonstatic","userdata","metatable","natsort","backstack","luajit","Succ","Succ","cand","fileencoding","foldmethod","lightgreen","darkgray","lightred","lightyellow","lightcyan","nushell","msvc","aarch"],"flagWords":[]} +{"version":"0.2","language":"en","words":["Punct","KEYMAP","splitn","crossterm","YAZI","unar","peekable","ratatui","syntect","pbpaste","pbcopy","ffmpegthumbnailer","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","nvim","indexmap","indexmap","unwatch","canonicalize","serde","fsevent","Ueberzug","iterm","wezterm","sixel","chafa","ueberzugpp","️ Überzug","️ Überzug","Konsole","Alacritty","Überzug","pkgs","paru","unarchiver","pdftoppm","poppler","prebuild","singlefile","jpegopt","EXIF","rustfmt","mktemp","nanos","xclip","xsel","natord","Mintty","nixos","nixpkgs","SIGTSTP","SIGCONT","SIGCONT","mlua","nonstatic","userdata","metatable","natsort","backstack","luajit","Succ","Succ","cand","fileencoding","foldmethod","lightgreen","darkgray","lightred","lightyellow","lightcyan","nushell","msvc","aarch","linemode"],"flagWords":[]} diff --git a/plugin/preset/components/folder.lua b/plugin/preset/components/folder.lua index 7c01d7f16..8b13c5cf6 100644 --- a/plugin/preset/components/folder.lua +++ b/plugin/preset/components/folder.lua @@ -59,9 +59,11 @@ function Folder:linemode(area) elseif mode == "permissions" then spans[#spans + 1] = ui.Span(f:permissions() or "") end + + spans[#spans + 1] = ui.Span(" ") lines[#lines + 1] = ui.Line(spans) end - return ui.Paragraph(area:padding(ui.Padding.right(1)), lines):align(ui.Alignment.RIGHT) + return ui.Paragraph(area, lines):align(ui.Alignment.RIGHT) end function Folder:markers(area, markers)