Skip to content

fix: 指定编译系统 #8

fix: 指定编译系统

fix: 指定编译系统 #8

Workflow file for this run

name: release
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
target:

Check failure on line 13 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

You have an error in your yaml syntax on line 13
- name: x86_64-unknown-linux-musl
file_name : "linux-x86_64"
os: ubuntu-latest
- name: i686-unknown-linux-musl
file_name : "linux-x86"
os: ubuntu-latest
- name: aarch64-unknown-linux-musl
file_name : "linux-aarch64"
os: ubuntu-latest
- name: i686-pc-windows-msvc
file_name : "windows-x86"
os: windows-latest
- name: x86_64-pc-windows-msvc
file_name : "windows-x86_64"
os: windows-latest
- name: x86_64-apple-darwin
file_name : "macos-x86_64"
os: macos-latest
- name: aarch64-apple-darwin
file_name : "macos-aarch64"
os: macos-latest
runs-on: ${{ matrix.target.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target.name }}
- name: Install dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y libudev-dev libusb-1.0-0-dev libssl-dev pkg-config
cargo install cross --git https://github.com/cross-rs/cross
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg -y; done
# Add Docker's official GPG key:
sudo apt-get update -y
sudo apt-get install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -y
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl start docker
- name: Build
run: cross build --release --target ${{ matrix.target.name }}
- name: package # 将编译好的二进制文件打包,如果是Windows就打包exe文件,其它系统打包AirISP*文件
run: |
if [[ ${{ matrix.target.name }} =~ "windows" ]]
then
zip -j ~/release/AirISP-${{ matrix.target.file_name }}.zip target/${{ matrix.target.name }}/release/AirISP-next.exe
else
zip -j ~/release/AirISP-${{ matrix.target.file_name }}.zip target/${{ matrix.target.name }}/release/AirISP-next.exe
fi
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "~/release/AirISP-${{ matrix.target.file_name }}.zip"