550ba9a90c
Release / Build aarch64-unknown-linux-gnu (push) Has been cancelled
Release / Build aarch64-apple-darwin (push) Has been cancelled
Release / Build aarch64-pc-windows-msvc (push) Has been cancelled
Release / Build x86_64-unknown-linux-gnu (push) Has been cancelled
Release / Build x86_64-apple-darwin (push) Has been cancelled
Release / Build x86_64-pc-windows-msvc (push) Has been cancelled
Release / Create GitHub Release (push) Has been cancelled
103 lines
2.6 KiB
YAML
103 lines
2.6 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags: ["v*"]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
name: Build ${{ matrix.target }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# Linux
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
artifact: sshell-x86_64-linux
|
|
- os: ubuntu-latest
|
|
target: aarch64-unknown-linux-gnu
|
|
artifact: sshell-aarch64-linux
|
|
# macOS
|
|
- os: macos-latest
|
|
target: aarch64-apple-darwin
|
|
artifact: sshell-aarch64-macos
|
|
- os: macos-26-intel
|
|
target: x86_64-apple-darwin
|
|
artifact: sshell-x86_64-macos
|
|
# Windows
|
|
- os: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
artifact: sshell-x86_64-windows.exe
|
|
- os: windows-latest
|
|
target: aarch64-pc-windows-msvc
|
|
artifact: sshell-aarch64-windows.exe
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Install cross-compilation tools (Linux aarch64)
|
|
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y gcc-aarch64-linux-gnu
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: ${{ matrix.target }}
|
|
|
|
- name: Build
|
|
run: cargo build --release --target ${{ matrix.target }}
|
|
|
|
- name: Package (Unix)
|
|
if: runner.os != 'Windows'
|
|
run: |
|
|
cp target/${{ matrix.target }}/release/sshell sshell
|
|
chmod +x sshell
|
|
tar czf ${{ matrix.artifact }}.tar.gz sshell
|
|
|
|
- name: Package (Windows)
|
|
if: runner.os == 'Windows'
|
|
run: |
|
|
copy target\${{ matrix.target }}\release\sshell.exe sshell.exe
|
|
Compress-Archive -Path sshell.exe -DestinationPath ${{ matrix.artifact }}.zip
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.artifact }}
|
|
path: |
|
|
${{ matrix.artifact }}.tar.gz
|
|
${{ matrix.artifact }}.zip
|
|
|
|
release:
|
|
name: Create GitHub Release
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
merge-multiple: true
|
|
|
|
- name: Create release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
artifacts/*.tar.gz
|
|
artifacts/*.zip
|