From 019ff0a26635b28f673e4bc3917de760bc1bf834 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 7 Nov 2021 19:38:48 +0100 Subject: [PATCH] Add github action to build releases Signed-off-by: trivernis --- mediarepo-daemon/.github/workflows/build.yml | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 mediarepo-daemon/.github/workflows/build.yml diff --git a/mediarepo-daemon/.github/workflows/build.yml b/mediarepo-daemon/.github/workflows/build.yml new file mode 100644 index 0000000..61a5974 --- /dev/null +++ b/mediarepo-daemon/.github/workflows/build.yml @@ -0,0 +1,41 @@ +name: Build releases for multiple platforms + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main, develop ] + +env: + CARGO_TERM_COLOR: always + +jobs: + + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + + - name: Cache build data + uses: actions/cache@v2 + with: + path: | + target + ~/.cargo/ + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Build + run: cargo build --release + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: mediarepo-daemon-${{ runner.os }} + path: | + target/release/mediarepo-daemon* \ No newline at end of file