Skip to content

Commit

Permalink
chore: package/cross-compile (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
markphelps authored Dec 20, 2023
1 parent 12b14f0 commit b59f415
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 3 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build-engine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Package Rust Engine
on:
release:
types: [published]
workflow_dispatch:

jobs:
build:
strategy:
matrix:
platform:
- name: Linux-x86_64
os: ubuntu-latest
use_cross: false
target: x86_64-unknown-linux-gnu
- name: Linux-arm64
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
use_cross: true
- name: Darwin-arm64
os: macos-latest
target: aarch64-apple-darwin
use_cross: false

runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v3

- name: Install Rust ${{ matrix.platform.name }}
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.platform.target }}
override: true

- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.platform.target}}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build Rust ${{ matrix.platform.name }}
uses: actions-rs/cargo@v1
with:
command: build
args: --target ${{ matrix.platform.target }} --release
use-cross: ${{ matrix.platform.use_cross }}

- uses: actions/upload-artifact@v4
with:
name: fliptengine-${{ matrix.platform.name }}
path: |
target/${{ matrix.platform.target }}/release/libfliptengine.*
target/${{ matrix.platform.target }}/release/flipt_engine.h
retention-days: 5
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust Engine
name: Lint/Test Rust Engine
on:
push:
branches:
Expand Down
1 change: 1 addition & 0 deletions flipt-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ crc32fast = "1.3.2"
chrono = { version = "0.4.31", features = ["serde", "rustc-serialize"] }
futures = "0.3"
thiserror = "1.0.50"
openssl = { version = "0.10", features = ["vendored"] }

[build-dependencies]
cbindgen = "0.26.0"
Expand Down
5 changes: 3 additions & 2 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,14 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/urfave/cli/v2 v2.24.4 h1:0gyJJEBYtCV87zI/x2nZCPyDxD51K6xM8SkwjHFCNEU=
github.com/urfave/cli/v2 v2.24.4/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
Expand Down

0 comments on commit b59f415

Please sign in to comment.