Skip to content

Update ci.yml

Update ci.yml #8

Workflow file for this run

name: Publish afptool-rs
on:
push:
tags:
- '*'
jobs:
build:
name: Publish binaries
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
# 检出代码
- name: Checkout source code
uses: actions/checkout@v3
# 设置 Rust 工具链
- name: Set up Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# 构建项目
- name: Build project
run: cargo build --release
# 打包二进制文件
- name: Package binary
run: |
mkdir -p dist
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp target/release/afptool-rs.exe dist/afptool-rs-${{ matrix.os }}.exe
else
cp target/release/afptool-rs dist/afptool-rs-${{ matrix.os }}
fi
# 上传二进制文件到 Release
- uses: actions/upload-artifact@v4
with:
name: afptool-rs-${{ matrix.os }}
path: dist/afptool-rs-${{ matrix.os }}*
if-no-files-found: error