From 9b466ce97eaf31ad83a0b7564bdd42be6dd173e3 Mon Sep 17 00:00:00 2001 From: Vladimir Rubin Date: Mon, 30 Dec 2024 17:40:41 +0200 Subject: [PATCH] ci: add automatic builds --- .forgejo/workflows/build.yml | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .forgejo/workflows/build.yml diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..e3fb930 --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,49 @@ +name: Build and Upload filesorters Binaries + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build-linux: + name: Build for Linux + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Build for Linux + run: cargo build --release + + - name: Upload Linux artifact + uses: forgejo/upload-artifact@v4 + with: + name: linux-binary + path: target/release/filesorters + + build-windows: + name: Build for Windows + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install cross + run: cargo install cross + + - name: Build for Windows + run: cross build --release --target x86_64-pc-windows-gnu + + - name: Upload Windows artifact + uses: forgejo/upload-artifact@v4 + with: + name: windows-binary + path: target/x86_64-pc-windows-gnu/release/filesorters.exe