2023-10-21 07:18:26 +03:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
|
|
|
|
|
|
jobs:
|
2023-10-21 08:27:26 +03:00
|
|
|
release:
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2023-10-21 07:18:26 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
target: x86_64-unknown-linux-gnu
|
2023-10-27 15:58:34 +03:00
|
|
|
- os: ubuntu-latest
|
|
|
|
target: aarch64-unknown-linux-gnu
|
2023-10-21 07:18:26 +03:00
|
|
|
- os: windows-latest
|
|
|
|
target: x86_64-pc-windows-msvc
|
|
|
|
- os: macos-latest
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
- os: macos-latest
|
|
|
|
target: aarch64-apple-darwin
|
|
|
|
|
2023-10-21 08:27:26 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
2023-10-21 07:18:26 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2023-10-21 08:27:26 +03:00
|
|
|
- name: Add aarch64 target
|
2023-10-27 15:58:34 +03:00
|
|
|
if: contains(fromJson('["aarch64-unknown-linux-gnu", "aarch64-apple-darwin"]'), matrix.target)
|
|
|
|
run: rustup target add ${{ matrix.target }}
|
|
|
|
|
|
|
|
- name: Install gcc-aarch64-linux-gnu
|
|
|
|
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -yq gcc-aarch64-linux-gnu
|
2023-10-21 08:27:26 +03:00
|
|
|
|
|
|
|
- name: Cache dependencies
|
2023-10-21 07:18:26 +03:00
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
|
|
|
- name: Build
|
2023-10-22 11:34:20 +03:00
|
|
|
env:
|
|
|
|
YAZI_GEN_COMPLETIONS: true
|
2023-10-27 15:58:34 +03:00
|
|
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc
|
2023-10-21 07:18:26 +03:00
|
|
|
run: cargo build --release --locked --target ${{ matrix.target }}
|
|
|
|
|
2023-10-21 08:27:26 +03:00
|
|
|
- name: Pack artifacts [Linux & macOS]
|
2023-10-21 07:18:26 +03:00
|
|
|
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
|
|
|
|
env:
|
2023-10-21 08:27:26 +03:00
|
|
|
TARGET_NAME: yazi-${{ matrix.target }}
|
2023-10-21 07:18:26 +03:00
|
|
|
run: |
|
2023-10-21 08:27:26 +03:00
|
|
|
mkdir $TARGET_NAME
|
|
|
|
cp target/${{ matrix.target }}/release/yazi $TARGET_NAME
|
2023-10-22 13:54:24 +03:00
|
|
|
cp -r yazi-config/completions $TARGET_NAME
|
2023-10-21 08:27:26 +03:00
|
|
|
cp README.md LICENSE $TARGET_NAME
|
|
|
|
zip -r $TARGET_NAME.zip $TARGET_NAME
|
2023-10-21 07:18:26 +03:00
|
|
|
|
2023-10-21 08:27:26 +03:00
|
|
|
- name: Pack artifacts [Windows]
|
2023-10-21 07:18:26 +03:00
|
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
env:
|
2023-10-21 08:27:26 +03:00
|
|
|
TARGET_NAME: yazi-${{ matrix.target }}
|
2023-10-21 07:18:26 +03:00
|
|
|
run: |
|
2023-10-21 08:27:26 +03:00
|
|
|
New-Item -ItemType Directory -Path ${env:TARGET_NAME}
|
|
|
|
Copy-Item -Path "target\${{ matrix.target }}\release\yazi.exe" -Destination ${env:TARGET_NAME}
|
2023-10-22 13:54:24 +03:00
|
|
|
Copy-Item -Path "yazi-config\completions" -Destination ${env:TARGET_NAME} -Recurse
|
2023-10-21 08:27:26 +03:00
|
|
|
Copy-Item -Path "README.md", "LICENSE" -Destination ${env:TARGET_NAME}
|
|
|
|
Compress-Archive -Path ${env:TARGET_NAME} -DestinationPath "${env:TARGET_NAME}.zip"
|
2023-10-21 07:18:26 +03:00
|
|
|
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
with:
|
2023-10-21 08:27:26 +03:00
|
|
|
draft: true
|
2023-10-21 07:18:26 +03:00
|
|
|
files: yazi-${{ matrix.target }}.zip
|
2023-10-21 08:27:26 +03:00
|
|
|
generate_release_notes: true
|