From 02ed5d690dd1615686bdd7ee103fc0db23b76a61 Mon Sep 17 00:00:00 2001 From: Marcelo Altmann Date: Tue, 13 Aug 2024 12:11:25 -0300 Subject: [PATCH] test build on MacOS --- .github/workflows/build_arm.yml | 38 +++++++++++++++++++ .../workflows/{build.yml => build_x64.yml} | 0 Dockerfile | 5 +++ 3 files changed, 43 insertions(+) create mode 100644 .github/workflows/build_arm.yml rename .github/workflows/{build.yml => build_x64.yml} (100%) create mode 100644 Dockerfile diff --git a/.github/workflows/build_arm.yml b/.github/workflows/build_arm.yml new file mode 100644 index 0000000..6f22377 --- /dev/null +++ b/.github/workflows/build_arm.yml @@ -0,0 +1,38 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: build docker base image + run: docker build -t rust-compile-image . + + - name: Run the build process with Docker + uses: addnab/docker-run-action@v3 + with: + image: rust-compile-image + options: -v "${{ github.workspace }}":/usr/src/myapp -w /usr/src/myapp + run: | + cargo build --release + cargo generate-rpm + cargo deb + - name: Save RPM / DEB name + run: | + echo "rpm_name=$(ls target/generate-rpm/)" >> "$GITHUB_ENV" + echo "deb_name=$(ls target/debian/ -I *-stripped)" >> "$GITHUB_ENV" + + - name: Upload RPM + uses: actions/upload-artifact@v4 + with: + path: target/generate-rpm/ + name: ${{ env.rpm_name }} + + - name: Upload Deb + uses: actions/upload-artifact@v4 + with: + path: target/debian/${{ env.deb_name }} + name: ${{ env.deb_name }} diff --git a/.github/workflows/build.yml b/.github/workflows/build_x64.yml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows/build_x64.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9280624 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +# Use the latest official Rust +FROM rust:latest + +# install dependencies +RUN cargo install cargo-generate-rpm cargo-deb