Skip to content

Commit

Permalink
chore: sign macos binary
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed May 24, 2024
1 parent cef35ba commit 88f43f8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ jobs:
name: macos-arm64
target: aarch64-apple-darwin
runs-on: macos-14
# - os: macos
# name: macos
# target: universal2-apple-darwin
# runs-on: macos-12
steps:
- if: matrix.os == 'macos'
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTS_P12 }}
p12-password: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTS_P12_PASS }}
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions scripts/build-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ cp LICENSE dist/mise/LICENSE
cp {,dist/mise/}man/man1/mise.1
cp {,dist/mise/}share/fish/vendor_conf.d/mise-activate.fish

if [[ "$(get_os)" == "macos" ]]; then
codesign -f -s "Developer ID Application: Jeffrey Dickey (4993Y37DX6)" dist/mise/bin/mise
fi

cd dist
tar -cJf "$BASENAME.tar.xz" mise
tar -czf "$BASENAME.tar.gz" mise
Expand Down
5 changes: 3 additions & 2 deletions src/cli/direnv/envrc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use std::fs::{create_dir_all, File};
use std::fs::File;
use std::io::Write;

use eyre::Result;
use xx::file;

use crate::config::Config;
use crate::env;
Expand All @@ -23,7 +24,7 @@ impl Envrc {
.join(hash_to_str(&env::current_dir()?) + ".envrc");

// TODO: exit early if envrc_path exists and is up to date
create_dir_all(envrc_path.parent().unwrap())?;
file::mkdirp(envrc_path.parent().unwrap())?;
let mut file = File::create(&envrc_path)?;

writeln!(
Expand Down
4 changes: 2 additions & 2 deletions src/cli/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl Exec {
self.exec(program, args, env)
}

#[cfg(not(test))]
#[cfg(not(any(test, target_os = "windows")))]
fn exec<T, U, E>(&self, program: T, args: U, env: BTreeMap<E, E>) -> Result<()>
where
T: IntoExecutablePath,
Expand All @@ -87,7 +87,7 @@ impl Exec {
bail!("{:?} {err}", program.to_string_lossy())
}

#[cfg(test)]
#[cfg(any(test, target_os = "windows"))]
fn exec<T, U, E>(&self, program: T, args: U, env: BTreeMap<E, E>) -> Result<()>
where
T: IntoExecutablePath,
Expand Down
3 changes: 2 additions & 1 deletion src/cli/render_mangen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::path::{Path, PathBuf};
use std::{env, fs};

use eyre::Result;
use xx::file;

use crate::cli::{version, Cli};

Expand All @@ -21,7 +22,7 @@ impl RenderMangen {
man.render(&mut buffer)?;

let out_dir = project_root().join("man").join("man1");
fs::create_dir_all(&out_dir)?;
file::mkdirp(&out_dir)?;
fs::write(out_dir.join("mise.1"), buffer)?;

Ok(())
Expand Down
9 changes: 7 additions & 2 deletions src/git.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::fs::create_dir_all;
use std::path::PathBuf;

use duct::Expression;
use eyre::{eyre, Result, WrapErr};
use once_cell::sync::OnceCell;
use xx::file;

use crate::cmd;
use crate::file::touch_dir;
Expand Down Expand Up @@ -98,7 +98,12 @@ impl Git {
pub fn clone(&self, url: &str) -> Result<()> {
debug!("cloning {} to {}", url, self.dir.display());
if let Some(parent) = self.dir.parent() {
create_dir_all(parent)?;
file::mkdirp(parent)?;
}
if let Err(err) = git2::Repository::clone(url, &self.dir) {
warn!("git clone failed: {err:#}");
} else {
return Ok(());
}
match get_git_version() {
Ok(version) => trace!("git version: {}", version),
Expand Down

0 comments on commit 88f43f8

Please sign in to comment.