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 2cdadec
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release
on:
pull_request:
workflow_dispatch:
inputs:
component:
description: The software component to release
required: true
type: choice
options:
- identity-server

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 2cdadec

Please sign in to comment.