Skip to content

Commit

Permalink
Merge pull request #44 from SpiralOutDotEu/ci/multi-os-build
Browse files Browse the repository at this point in the history
ci(ci): ✨ Add multi-os builds for win & mac
  • Loading branch information
SpiralOutDotEu committed Nov 3, 2023
2 parents 4fff47f + 75da39d commit d94364f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ module.exports = {
"changelogFile": "CHANGELOG.md",
}],
["@semantic-release/github", {
"assets": "target/release/zk_whitelist"
"assets": [
{"path": "target/release/zk_whitelist", "label": "Linux binary"},
{"path": "target/release/zk_whitelist.exe", "label": "Windows binary"},
{"path": "target/release/zk_whitelist.dmg", "label": "macOS binary"}
]
}],
["@semantic-release/git", {
"assets": ["CHANGELOG.md", "Cargo.toml", "Cargo.lock"],
Expand Down
16 changes: 16 additions & 0 deletions update_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,19 @@ rm $CARGO_LOCK.bak

# Build the project with the updated version number
cargo build --release

# Prepare for multi-os build
sudo apt-get install podman
cargo install cross

# Build for Windows
rustup target add x86_64-pc-windows-gnu

# build for Mac
curl -L https://github.com/roblabla/MacOSX-SDKs/releases/download/13.3/MacOSX13.3.sdk.tar.xz | tar xJ
export SDKROOT=$(pwd)/MacOSX13.3.sdk/
export PATH=$PATH:~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/
export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=rust-lld
rustup target add x86_64-apple-darwin
cargo build --release --target x86_64-apple-darwin

0 comments on commit d94364f

Please sign in to comment.