Update rust.yml workflow action to save used space in github #84
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 CI and Release | |
on: | |
push: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_and_release: | |
runs-on: ubuntu-latest | |
container: | |
image: rust:1.70-slim7-bullseye | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Build Release | |
run: cargo build --release --verbose | |
- name: Prepare Release Asset | |
run: | | |
mkdir -p assets/bin/linux_x64 | |
cp target/release/wami assets/bin/linux_x64/wami | |
chmod +x assets/bin/linux_x64/wami | |
- name: Create Releass | |
uses: softprops/actions-gh-release@1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: assets/bin/linux_x64/wami | |
tag_name: linux_x64 | |
name: Release Linux x64 | |
body: This is the new release of the Linux x64 wami binary file | |
draft: false | |
prerelease: false | |
- name: Clean up | |
if: always() | |
run: | | |
rm -rf assets | |
rm -rf target | |
cargo clean | |
rm -rf ~/.cargo/registry | |
rm -rf ~/.cargo/git | |
df -h # Displays the available storage space |