Skip to content

Commit

Permalink
fix: Release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Blackman committed Nov 26, 2023
1 parent 2b9e141 commit be9d9ca
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[build]
rustflags = ["--remap-path-prefix", "$HOME=/home", "--remap-path-prefix", "$PWD=/app"]

[alias]
xtask = ["run", "-p", "xtask", "--"]
about = ["bin", "cargo-about"]
Expand Down
15 changes: 9 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ committed = { version = "1.0.20" }
dprint = { version = "0.40.2" }
git-cliff = { version = "1.3.1" }

[profile.release]
lto = true

[profile.dev.package]
insta.opt-level = 3
similar.opt-level = 3
Expand Down Expand Up @@ -182,12 +185,12 @@ release = '''set -e
git tag -d "v$OM_VERSION"
git tag -a "v$OM_VERSION" -m "v$OM_VERSION"
cargo zigbuild --release --target x86_64-apple-darwin
cargo zigbuild --release --target aarch64-apple-darwin
cargo zigbuild --release --target x86_64-unknown-linux-gnu
cargo zigbuild --release --target aarch64-unknown-linux-gnu
cargo xwin build --release --target x86_64-pc-windows-msvc --xwin-arch x86_64 --xwin-cache-dir .bin/xwin/x86_64
cargo xwin build --release --target aarch64-pc-windows-msvc --xwin-arch aarch64 --xwin-cache-dir .bin/xwin/aarch64
./tools/release-env.sh zigbuild --release --target x86_64-apple-darwin
./tools/release-env.sh zigbuild --release --target aarch64-apple-darwin
./tools/release-env.sh zigbuild --release --target x86_64-unknown-linux-gnu
./tools/release-env.sh zigbuild --release --target aarch64-unknown-linux-gnu
./tools/release-env.sh xwin build --release --target x86_64-pc-windows-msvc --xwin-arch x86_64 --xwin-cache-dir .bin/xwin/x86_64
./tools/release-env.sh xwin build --release --target aarch64-pc-windows-msvc --xwin-arch aarch64 --xwin-cache-dir .bin/xwin/aarch64
git push
git push --tags
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "1.73.0"
channel = "1.74.0"
components = ["rustfmt", "clippy", "llvm-tools-preview"]
targets = [
"x86_64-apple-darwin",
Expand Down
13 changes: 13 additions & 0 deletions tools/release-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

export PATHTMP=$(echo "$PATH" | sd ':' '\n' | grep -E '(^/usr|^/bin|homebrew)' | grep -v "$USER" | sd '\n' ':')
export HOMETMP="$TMPDIR/homedir-$(basename "$PWD")"

rm -rf "$HOMETMP"
mkdir -p "$HOMETMP"
ln -s "$HOME/.cargo" "$HOMETMP/.cargo"
ln -s "$HOME/.rustup" "$HOMETMP/.rustup"

env -i PATH="$PATHTMP:$HOMETMP/.cargo/bin" HOME="$HOMETMP" bash --noprofile --norc -c "cargo $*"

rm -rf "$HOMETMP"

0 comments on commit be9d9ca

Please sign in to comment.