Skip to content

Commit

Permalink
chore: more macos ci config
Browse files Browse the repository at this point in the history
  • Loading branch information
EverlastingBugstopper committed Mar 2, 2022
1 parent d13d2fd commit c2aa6eb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
16 changes: 16 additions & 0 deletions macos-entitlements.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>
13 changes: 8 additions & 5 deletions xtask/src/commands/package/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::path::Path;
use std::process::{Command, Stdio};
use structopt::StructOpt;

use crate::utils::{PKG_PROJECT_ROOT, PKG_VERSION};
use crate::utils::PKG_PROJECT_ROOT;

const ENTITLEMENTS: &str = "macos-entitlements.plist";

Expand Down Expand Up @@ -41,7 +41,12 @@ pub struct PackageMacos {
}

impl PackageMacos {
pub fn run(&self, release_path: impl AsRef<Path>, bin_name: &str) -> Result<()> {
pub fn run(
&self,
release_path: impl AsRef<Path>,
bin_name: &str,
version: &Version,
) -> Result<()> {
let release_path = release_path.as_ref();
let temp = tempfile::tempdir().context("could not create temporary directory")?;

Expand Down Expand Up @@ -183,9 +188,7 @@ impl PackageMacos {
);

crate::info!("Zipping dist...");
let dist_zip = temp
.path()
.join(format!("{}-{}.zip", bin_name, *PKG_VERSION));
let dist_zip = temp.path().join(format!("{}-{}.zip", bin_name, version));
let mut zip = zip::ZipWriter::new(std::io::BufWriter::new(
std::fs::File::create(&dist_zip).context("could not create file")?,
));
Expand Down
3 changes: 2 additions & 1 deletion xtask/src/commands/package/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ impl Package {
);

#[cfg(target_os = "macos")]
self.macos.run(&release_path, &bin_name)?;
self.macos
.run(&release_path, &bin_name, &self.package_version)?;

if !self.output.exists() {
std::fs::create_dir_all(&self.output).context("Couldn't create output directory")?;
Expand Down

0 comments on commit c2aa6eb

Please sign in to comment.