mirror of
https://github.com/localsend/localsend.git
synced 2026-10-25 06:23:14 +08:00
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
name: Build linux CLI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
version: ${{ steps.get_version.outputs.version }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Get version from pubspec.yaml
|
|
id: get_version
|
|
run: |
|
|
VERSION=$(sed -n 's/^version: \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' app/pubspec.yaml)
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
|
|
build_cli:
|
|
needs: build
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- runner: ubuntu-22.04
|
|
suffix: linux-x86-64
|
|
- runner: ubuntu-22.04-arm
|
|
suffix: linux-arm-64
|
|
runs-on: ${{ matrix.runner }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Install Rust
|
|
run: rustup toolchain install # version from rust-toolchain.toml
|
|
|
|
- name: Compile CLI
|
|
run: cargo build --release --package localsend-cli
|
|
|
|
# tar preserves the executable bit, which a bare artifact upload would lose
|
|
- name: Create tar.gz archive
|
|
run: tar -czvf LocalSend-CLI-${{ needs.build.outputs.version }}-${{ matrix.suffix }}.tar.gz -C target/release localsend-cli
|
|
|
|
- name: Upload CLI
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: cli-${{ matrix.suffix }}-result
|
|
path: LocalSend-CLI-${{ needs.build.outputs.version }}-${{ matrix.suffix }}.tar.gz
|
|
if-no-files-found: error
|