Update rust.yml #3
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: Rust | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Build | |
run: cargo build --release --verbose | |
- name: Set the binary name | |
shell: bash | |
run: echo "BINARY_NAME=$(python -c "import platform; uname=platform.uname(); print(f'lorust_{uname.system}_{uname.machine}.exe')")" >> "$GITHUB_ENV" | |
- name: Renmae the built binary | |
shell: bash | |
continue-on-error: true | |
run: mv target/release/lorust ./$BINARY_NAME | |
- name: Renmae the built binary | |
shell: bash | |
continue-on-error: true | |
run: mv target/release/lorust.exe $BINARY_NAME | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
# Artifact name | |
name: ${{ env.BINARY_NAME }} | |
# A file, directory or wildcard pattern that describes what to upload | |
path: ${{ env.BINARY_NAME }} |