Skip to content

Commit 911f5d7

Browse files
committed
refactor: cleanup auths init by removing registration, adding auto signers file to repo, remove intel mac builds
1 parent 3a3f71f commit 911f5d7

8 files changed

Lines changed: 30 additions & 57 deletions

File tree

.github/workflows/publish-node.yml

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -119,48 +119,9 @@ jobs:
119119
working-directory: packages/auths-node
120120
run: pnpm test
121121

122-
universal-macos:
123-
name: Universal macOS binary
124-
needs: [build]
125-
runs-on: macos-latest
126-
steps:
127-
- uses: actions/checkout@v4
128-
129-
- uses: actions/setup-node@v4
130-
with:
131-
node-version: 22
132-
133-
- name: Install pnpm
134-
run: npm install -g pnpm
135-
136-
- name: Install dependencies
137-
working-directory: packages/auths-node
138-
run: pnpm install
139-
140-
- uses: actions/download-artifact@v4
141-
with:
142-
name: bindings-aarch64-apple-darwin
143-
path: packages/auths-node/artifacts
144-
145-
- uses: actions/download-artifact@v4
146-
with:
147-
name: bindings-x86_64-apple-darwin
148-
path: packages/auths-node/artifacts
149-
150-
- name: Build universal binary
151-
working-directory: packages/auths-node
152-
run: |
153-
pnpm artifacts
154-
pnpm universal
155-
156-
- uses: actions/upload-artifact@v4
157-
with:
158-
name: bindings-universal-apple-darwin
159-
path: packages/auths-node/auths.darwin-universal.node
160-
161122
publish:
162123
name: Publish to npm
163-
needs: [build, test, universal-macos]
124+
needs: [build, test]
164125
runs-on: ubuntu-latest
165126
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'npm')
166127
permissions:

crates/auths-cli/src/commands/init/gather.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub(crate) fn gather_developer_config(
4343
.with_conflict_policy(conflict_policy)
4444
.with_git_signing_scope(git_scope);
4545

46-
if !cmd.skip_registration {
46+
if cmd.register {
4747
builder = builder.with_registration(&cmd.registry);
4848
}
4949

crates/auths-cli/src/commands/init/mod.rs

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ mod prompts;
1212
use anyhow::{Result, anyhow};
1313
use clap::{Args, ValueEnum};
1414
use std::io::IsTerminal;
15+
use std::path::PathBuf;
1516
use std::sync::Arc;
1617

1718
use auths_core::PrefilledPassphraseProvider;
@@ -29,6 +30,7 @@ use crate::config::CliConfig;
2930
use crate::factories::storage::build_auths_context;
3031
use crate::ux::format::Output;
3132

33+
use super::signers::{SignersSyncArgs, handle_sync};
3234
use display::{
3335
display_agent_dry_run, display_agent_result, display_ci_result, display_developer_result,
3436
};
@@ -118,13 +120,13 @@ pub struct InitCommand {
118120
#[clap(long)]
119121
pub dry_run: bool,
120122

121-
/// Registry URL for automatic identity registration
123+
/// Registry URL for identity registration
122124
#[clap(long, default_value = DEFAULT_REGISTRY_URL)]
123125
pub registry: String,
124126

125-
/// Skip automatic registry registration during setup
127+
/// Register identity with the Auths Registry after creation
126128
#[clap(long)]
127-
pub skip_registration: bool,
129+
pub register: bool,
128130

129131
/// Scaffold a GitHub Actions workflow using the auths attest-action
130132
#[clap(long)]
@@ -240,7 +242,7 @@ fn run_developer_setup(
240242

241243
// PLATFORM VERIFICATION
242244
guide.section("Platform Verification");
243-
let proof_url = if interactive && !cmd.skip_registration {
245+
let proof_url = if interactive && cmd.register {
244246
out.print_info("Claim your Developer Passport");
245247
out.newline();
246248
match prompt_platform_verification(
@@ -267,13 +269,28 @@ fn run_developer_setup(
267269
offer_shell_completions(interactive, out)?;
268270
write_allowed_signers(&result.key_alias, out)?;
269271

272+
// Also write repo-local .auths/allowed_signers if we're inside a git repo,
273+
// so `auths verify` works immediately without extra flags.
274+
if let Ok(output) = std::process::Command::new("git")
275+
.args(["rev-parse", "--show-toplevel"])
276+
.output()
277+
&& output.status.success()
278+
{
279+
let root = PathBuf::from(String::from_utf8_lossy(&output.stdout).trim());
280+
let repo_signers = root.join(".auths").join("allowed_signers");
281+
let _ = handle_sync(&SignersSyncArgs {
282+
repo: "~/.auths".into(),
283+
output_file: Some(repo_signers),
284+
});
285+
}
286+
270287
// REGISTRATION & DISPLAY
271288
guide.section("Registration & Summary");
272289
let registered = submit_registration(
273290
&get_auths_repo_path()?,
274291
&cmd.registry,
275292
proof_url,
276-
cmd.skip_registration,
293+
!cmd.register, // skip unless --register is explicitly passed
277294
out,
278295
);
279296
display_developer_result(out, &result, registered.as_deref());
@@ -390,7 +407,7 @@ mod tests {
390407
force: false,
391408
dry_run: false,
392409
registry: DEFAULT_REGISTRY_URL.to_string(),
393-
skip_registration: false,
410+
register: false,
394411
github_action: false,
395412
};
396413
assert!(!cmd.interactive);
@@ -400,7 +417,7 @@ mod tests {
400417
assert!(!cmd.force);
401418
assert!(!cmd.dry_run);
402419
assert_eq!(cmd.registry, "https://auths-registry.fly.dev");
403-
assert!(!cmd.skip_registration);
420+
assert!(!cmd.register);
404421
assert!(!cmd.github_action);
405422
}
406423

@@ -414,7 +431,7 @@ mod tests {
414431
force: true,
415432
dry_run: false,
416433
registry: DEFAULT_REGISTRY_URL.to_string(),
417-
skip_registration: false,
434+
register: false,
418435
github_action: false,
419436
};
420437
assert!(cmd.non_interactive);
@@ -446,7 +463,7 @@ mod tests {
446463
force: false,
447464
dry_run: false,
448465
registry: DEFAULT_REGISTRY_URL.to_string(),
449-
skip_registration: false,
466+
register: false,
450467
github_action: false,
451468
};
452469
assert!(!resolve_interactive(&cmd).unwrap());
@@ -462,7 +479,7 @@ mod tests {
462479
force: false,
463480
dry_run: false,
464481
registry: DEFAULT_REGISTRY_URL.to_string(),
465-
skip_registration: false,
482+
register: false,
466483
github_action: false,
467484
};
468485
// Auto-detect returns is_terminal() — result depends on environment

crates/auths-cli/src/commands/signers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ fn handle_remove(args: &SignersRemoveArgs) -> Result<()> {
208208
Ok(())
209209
}
210210

211-
fn handle_sync(args: &SignersSyncArgs) -> Result<()> {
211+
pub(crate) fn handle_sync(args: &SignersSyncArgs) -> Result<()> {
212212
let repo_path = expand_tilde(&args.repo)?;
213213
let storage = RegistryAttestationStorage::new(&repo_path);
214214

packages/auths-mobile-swift/build-xcframework.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ fi
2121
echo "Checking Rust targets..."
2222
TARGETS=(
2323
"aarch64-apple-darwin" # macOS Apple Silicon
24-
"x86_64-apple-darwin" # macOS Intel
2524
"aarch64-apple-ios" # iOS device
2625
"aarch64-apple-ios-sim" # iOS Simulator (Apple Silicon)
2726
"x86_64-apple-ios" # iOS Simulator (Intel)

packages/auths-node/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"napi": {
1919
"binaryName": "auths",
2020
"targets": [
21-
"x86_64-apple-darwin",
2221
"aarch64-apple-darwin",
2322
"x86_64-unknown-linux-gnu",
2423
"aarch64-unknown-linux-gnu",

packages/auths-verifier-swift/build-xcframework.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ fi
2020
echo "Checking Rust targets..."
2121
TARGETS=(
2222
"aarch64-apple-darwin" # macOS Apple Silicon
23-
"x86_64-apple-darwin" # macOS Intel
2423
"aarch64-apple-ios" # iOS device
2524
"aarch64-apple-ios-sim" # iOS Simulator (Apple Silicon)
2625
"x86_64-apple-ios" # iOS Simulator (Intel)

scripts/.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ jobs:
3131
target: x86_64-unknown-linux-gnu
3232
- os: macos-latest
3333
target: aarch64-apple-darwin
34-
# - os: macos-13
35-
# target: x86_64-apple-darwin
3634
- os: windows-latest
3735
target: x86_64-pc-windows-msvc
3836
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)