Skip to content

Merge branch 'main' of https://github.com/harilvfs/rdevs #10

Merge branch 'main' of https://github.com/harilvfs/rdevs

Merge branch 'main' of https://github.com/harilvfs/rdevs #10

Workflow file for this run

name: Build Rust Release
on:
pull_request:
paths:
- '**/*.rs'
- 'Cargo.toml'
- 'src/main.rs'
push:
branches:
- main
paths:
- '**/*.rs'
- 'Cargo.toml'
- 'src/main.rs'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Build release binary
run: |
cargo build --release || { echo "Build failed"; exit 1; }
if [ -f target/release/rdevs ]; then
mkdir -p build
mv target/release/rdevs ./build/rdevs
else
echo "Binary not found. Build may have failed."
exit 1
fi
rm -rf target/release
- name: List build artifacts
run: ls ./build
- name: Commit and push the build directory
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add build/rdevs
git commit -m "Update build directory with new binary" || echo "No changes to commit"
git push https://x-access-token:${GITHUB_TOKEN}@github.com/harilvfs/rdevs.git HEAD:main || echo "Push failed. Check permissions."