Skip to content

Update rust.yml

Update rust.yml #3

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose --release
- name: Run tests
run: cargo test --verbose
- name: Rename binary for Windows
if: matrix.os == 'windows-latest'
run: mv ./target/release/crypt_guard ./target/release/crypt_guard.exe
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/crypt_guard${{ matrix.os == 'windows-latest' && '.exe' || '' }}
asset_name: crypt_guard-${{ matrix.os }}${{ matrix.os == 'windows-latest' && '.exe' || '' }}
asset_content_type: application/octet-stream