fix: 先单个编译试试 #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- name: x86_64-unknown-linux-gnu | |
file_name : "linux-x86_64" | |
# - name: x86_64-apple-darwin | |
# file_name : "macos-x86_64" | |
# - name: x86_64-pc-windows-msvc | |
# file_name : "windows-x86_64" | |
# - name: i686-unknown-linux-gnu | |
# file_name : "linux-x86" | |
# - name: i686-pc-windows-msvc | |
# file_name : "windows-x86" | |
# - name: aarch64-unknown-linux-gnu | |
# file_name : "linux-aarch64" | |
# - name: armv7-unknown-linux-gnueabihf | |
# file_name : "linux-armv7" | |
# - name: aarch64-apple-darwin | |
# file_name : "macos-aarch64" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target.name }} | |
- name: Install dependencies | |
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; done | |
# Add Docker's official GPG key: | |
sudo apt-get update | |
sudo apt-get install 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 | |
sudo apt-get install 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" | |