From 142d92790872a149fd5e2aa50f4afb12c1c06d5e Mon Sep 17 00:00:00 2001
From: Marcelo Altmann <marcelo@readyset.io>
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}    |  2 +-
 Dockerfile                                    |  5 +++
 3 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 .github/workflows/build_arm.yml
 rename .github/workflows/{build.yml => build_x64.yml} (99%)
 create mode 100644 Dockerfile

diff --git a/.github/workflows/build_arm.yml b/.github/workflows/build_arm.yml
new file mode 100644
index 0000000..9c2005e
--- /dev/null
+++ b/.github/workflows/build_arm.yml
@@ -0,0 +1,38 @@
+name: Build
+
+on: [push, pull_request]
+
+jobs:
+  build_macOS:
+    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 99%
rename from .github/workflows/build.yml
rename to .github/workflows/build_x64.yml
index fa7341f..9698dfb 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build_x64.yml
@@ -3,7 +3,7 @@ name: Build
 on: [push, pull_request]
 
 jobs:
-  build:
+  build_x64:
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@v4
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