3 Commits

Author SHA1 Message Date
224d18740f 修改自动构建
Some checks failed
build / build (ncmmiao-linux.tar.gz, linux, ubuntu-latest, stable, x86_64-unknown-linux-musl) (push) Has been cancelled
build / build (ncmmiao-macos.tar.gz, macos, macos-latest, stable, x86_64-apple-darwin) (push) Has been cancelled
build / build (ncmmiao-windows.7z, windows, windows-latest, stable-x86_64-msvc, x86_64-pc-windows-msvc) (push) Has been cancelled
2024-11-17 09:34:55 +08:00
f3de089067 测试自动构建 2024-11-17 09:22:53 +08:00
4137752c49 更改自动构建 2024-11-17 09:18:20 +08:00

View File

@ -1,8 +1,8 @@
name: build name: build
on: on:
push: push:
branches: tags:
- main - "v*.*.*"
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
build: build:
@ -23,7 +23,7 @@ jobs:
target: x86_64-apple-darwin target: x86_64-apple-darwin
archive-name: ncmmiao-macos.tar.gz archive-name: ncmmiao-macos.tar.gz
- build: windows - build: windows
os: windows-2019 os: windows-latest
rust: stable-x86_64-msvc rust: stable-x86_64-msvc
target: x86_64-pc-windows-msvc target: x86_64-pc-windows-msvc
archive-name: ncmmiao-windows.7z archive-name: ncmmiao-windows.7z
@ -31,7 +31,7 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v4.2.2
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
@ -39,7 +39,10 @@ jobs:
toolchain: ${{ matrix.rust }} toolchain: ${{ matrix.rust }}
profile: minimal profile: minimal
override: true override: true
components: rustfmt, clippy
target: ${{ matrix.target }} target: ${{ matrix.target }}
- name: Test
run: cargo test
- name: Build binary - name: Build binary
run: cargo build --verbose --release --target ${{ matrix.target }} run: cargo build --verbose --release --target ${{ matrix.target }}
@ -66,8 +69,9 @@ jobs:
# tar -czf "${{ matrix.archive-name }}" LICENSE README.md ncmmiao # tar -czf "${{ matrix.archive-name }}" LICENSE README.md ncmmiao
tar -czf "${{ matrix.archive-name }}" README.md ncmmiao tar -czf "${{ matrix.archive-name }}" README.md ncmmiao
fi fi
- name: Upload archive - name: Release archive
uses: actions/upload-artifact@v1 uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with: with:
name: ${{ matrix.archive-name }} # name: ${{ matrix.archive-name }}
path: archive/${{ matrix.archive-name }} files: archive/${{ matrix.archive-name }}