Update main.yml

This commit is contained in:
Alexandr Bogomyakov
2024-07-08 14:13:30 +03:00
committed by GitHub
parent 1824b681ba
commit 8b66d7395e

View File

@ -24,7 +24,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Set up Rust
uses: actions-rs/toolchain@v1
@ -39,46 +39,20 @@ jobs:
- name: Build project
run: cargo build --release --target ${{ matrix.target }}
- name: Run tests
run: cargo test --target ${{ matrix.target }}
- name: Strip binary on Linux and macOS
if: matrix.os != 'windows-latest'
run: strip target/${{ matrix.target }}/release/khm
- name: Strip binary on Windows
if: matrix.os == 'windows-latest'
run: |
sudo apt-get install -y llvm
llvm-strip-10 target/${{ matrix.target }}/release/khm.exe
- name: Upload release assets
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v2
with:
name: khm-${{ matrix.os }}
path: target/${{ matrix.target }}/release/
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download Linux build artifact
uses: actions/download-artifact@v4
with:
name: khm-ubuntu-latest
path: target/x86_64-unknown-linux-gnu/release/
- name: Download Windows build artifact
uses: actions/download-artifact@v4
with:
name: khm-windows-latest
path: target/x86_64-pc-windows-msvc/release/
- name: Download macOS build artifact
uses: actions/download-artifact@v4
with:
name: khm-macos-latest
path: target/x86_64-apple-darwin/release/
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
artifacts: "target/x86_64-apple-darwin/release/khm,target/x86_64-pc-windows-msvc/release/khm.exe,target/x86_64-unknown-linux-gnu/release/khm"
#bodyFile: "body.md"