Skip to content

Commit

Permalink
ci: release for all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
TheButlah committed Oct 5, 2024
1 parent 25a6d84 commit 9d9727e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release
on:
workflow_dispatch:

jobs:
build:
name: Build the code for each platform
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- uses: mlugg/[email protected]
with:
version: 0.13.0
- name: Cache cargo dependencies
uses: Swatinem/[email protected]
# - name: Install mingw
# run: sudo apt-get install -y mingw-w64

- name: Install cargo-zigbuild
run: cargo install --locked [email protected]

- name: Cargo zigbuild
run: |
scripts/build-release.sh
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ opt-level = 1
[profile.dev.package."*"]
# Seems to cause crashes on mac on opt-level 3
opt-level = 2

# What we use when producing artifacts to distribute
[profile.artifact]
inherits = "release"
lto = true
strip = true
debug = false
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
channel = "1.81.0" # See workspace Cargo.toml
components = ["rust-src"]
profile = "default"
targets = ["x86_64-pc-windows-msvc", "x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl", "aarch64-apple-darwin"]
targets = ["x86_64-pc-windows-gnu", "x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl", "aarch64-apple-darwin"]
13 changes: 13 additions & 0 deletions scripts/build-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -eux -o pipefail

main() {
cargo zigbuild \
--target x86_64-unknown-linux-musl \
--target aarch64-unknown-linux-musl \
--target x86_64-pc-windows-gnu \
--all
}

main

0 comments on commit 9d9727e

Please sign in to comment.