diff --git a/pkgs/by-name/as/asccli/package.nix b/pkgs/by-name/as/asccli/package.nix new file mode 100644 index 000000000000..140602c968e9 --- /dev/null +++ b/pkgs/by-name/as/asccli/package.nix @@ -0,0 +1,66 @@ +{ + buildGoModule, + fetchFromGitHub, + git, + lib, + versionCheckHook, +}: + +buildGoModule (finalAttrs: { + pname = "asccli"; + version = "1.0.1"; + + src = fetchFromGitHub { + owner = "rudrankriyam"; + repo = "App-Store-Connect-CLI"; + tag = "${finalAttrs.version}"; + hash = "sha256-e2USts+HC3skFvexeKhKSJT0KxHlB5LFr54lqGjhZqM="; + }; + + vendorHash = "sha256-712Q7KiFQyTDjX4Srhukv3eQ84MRjnQxrpgBfqK2xa4="; + + ldflags = [ + "-s" + "-w" + "-X main.version=${finalAttrs.version}" + "-X main.commit=${finalAttrs.src.rev}" + "-X main.date=1970-01-01T00:00:00Z" + ]; + + postInstall = '' + mv $out/bin/App-Store-Connect-CLI $out/bin/asc + ''; + + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + __darwinAllowLocalNetworking = true; + nativeCheckInputs = [ git ]; + preCheck = '' + export ASC_BYPASS_KEYCHAIN=1 + ''; + checkFlags = + let + skippedTests = [ + "TestDefaultRunSkillsCheckCommand_UsesSkillsBinaryCheckCommand" + "TestDefaultRunSkillsCheckCommand_FallsBackToNpxOffline" + "TestDefaultRunSkillsCheckCommand_OfflineCacheMissIsUnavailable" + "TestAuthLogoutCommand" + "TestAuthStatusInvalidBypassWarningPrintedOnce" + ]; + in + [ + "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" + ]; + + meta = { + description = "Scriptable CLI for the App Store Connect API"; + homepage = "https://asccli.sh"; + changelog = "https://github.com/rudrankriyam/App-Store-Connect-CLI/releases/tag/${finalAttrs.version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ + DimitarNestorov + ]; + mainProgram = "asc"; + }; +})