rust-remote/.github/workflows/rust.yml
Ahmet Kaan GÜMÜŞ 6d4e8062fb ci: 💚 fix naming
2024-07-08 15:33:23 +03:00

100 lines
No EOL
2.7 KiB
YAML

name: Rust -> Build & Test & Release
on:
push:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --verbose
- name: Upload Linux Binary
uses: actions/upload-artifact@v3
with:
name: rust-remote-linux-x86_64
path: target/release/rust-remote
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --verbose
- name: Upload Windows Binary
uses: actions/upload-artifact@v3
with:
name: rust-remote-windows-x86_64
path: target/release/rust-remote.exe
build_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --verbose
- name: Upload MacOS Binary
uses: actions/upload-artifact@v3
with:
name: rust-remote-macos-arm64
path: target/release/rust-remote
release:
needs: [build_linux, build_windows, build_macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Forge a Folder
run: mkdir Downloads
working-directory: /home/runner/work/rust-remote/rust-remote/
- uses: actions/download-artifact@v3
name: Download
with:
path: Downloads/
- name: Rename Binaries
run: |
mv Downloads/rust-remote-linux-x86_64/rust-remote Downloads/rust-remote-linux-x86_64/rust-remote-linux-x86_64
mv Downloads/rust-remote-windows-x86_64/rust-remote.exe Downloads/rust-remote-windows-x86_64/rust-remote-windows-x86_64.exe
mv Downloads/rust-remote-macos-arm64/rust-remote Downloads/rust-remote-macos-arm64/rust-remote-macos-arm64
- name: Git Commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "short_sha=$calculatedSha" >> $GITHUB_OUTPUT
- uses: softprops/action-gh-release@v0.1.15
name: Release
with:
tag_name: ${{ steps.vars.outputs.short_sha }}
generate_release_notes: true
files: |
Downloads/*linux*/*rust-remote*
Downloads/*windows*/*rust-remote*
Downloads/*macos*/*rust-remote*