@@ -68270,10 +68270,10 @@ class CliInstaller {
6827068270 async install(downloadUrl) {
6827168271 console.info(`Downloading 1Password CLI from: ${downloadUrl}`);
6827268272 const downloadPath = await tool_cache.downloadTool(downloadUrl);
68273- console.info(`Extracting 1Password CLI from: ${downloadPath}` );
68273+ console.info("Installing 1Password CLI" );
6827468274 const extractedPath = await tool_cache.extractZip(downloadPath);
6827568275 core.addPath(extractedPath);
68276- core.info(` 1Password CLI installed at ${extractedPath}` );
68276+ core.info(" 1Password CLI installed" );
6827768277 }
6827868278}
6827968279
@@ -68320,6 +68320,89 @@ var external_child_process_ = __nccwpck_require__(5317);
6832068320var external_fs_ = __nccwpck_require__(9896);
6832168321// EXTERNAL MODULE: external "path"
6832268322var external_path_ = __nccwpck_require__(6928);
68323+ ;// CONCATENATED MODULE: ./src/cli-installer/macos.ts
68324+
68325+
68326+
68327+
68328+
68329+
68330+
68331+
68332+ const execAsync = (0,external_util_.promisify)(external_child_process_.exec);
68333+ class MacOSInstaller extends CliInstaller {
68334+ version;
68335+ constructor(version) {
68336+ super();
68337+ this.version = version;
68338+ }
68339+ async installCli() {
68340+ const downloadUrl = this.downloadUrl();
68341+ core.info(`Downloading 1Password CLI ${this.version} from ${downloadUrl}`);
68342+ await this.install(downloadUrl);
68343+ }
68344+ downloadUrl() {
68345+ return `https://cache.agilebits.com/dist/1P/op2/pkg/${this.version}/op_apple_universal_${this.version}.pkg`;
68346+ }
68347+ // @actions/tool-cache package does not support .pkg files, so we need to handle the installation manually
68348+ async install(downloadUrl) {
68349+ console.info(`Downloading 1Password CLI from: ${downloadUrl}`);
68350+ const pkgPath = await tool_cache.downloadTool(downloadUrl);
68351+ const pkgWithExtension = `${pkgPath}.pkg`;
68352+ external_fs_.renameSync(pkgPath, pkgWithExtension);
68353+ const expandDir = "temp-pkg";
68354+ await execAsync(`pkgutil --expand "${pkgWithExtension}" "${expandDir}"`);
68355+ const payloadPath = external_path_.join(expandDir, "op.pkg", "Payload");
68356+ console.info("Installing 1Password CLI");
68357+ const cliPath = await tool_cache.extractTar(payloadPath);
68358+ core.addPath(cliPath);
68359+ external_fs_.rmSync(expandDir, { recursive: true, force: true });
68360+ external_fs_.rmSync(pkgPath, { force: true });
68361+ core.info("1Password CLI installed");
68362+ }
68363+ }
68364+
68365+ ;// CONCATENATED MODULE: ./src/cli-installer/windows.ts
68366+
68367+ class WindowsInstaller extends CliInstaller {
68368+ arch;
68369+ version;
68370+ constructor(version) {
68371+ super();
68372+ this.version = version;
68373+ this.arch = "amd64"; // GitHub-hosted Windows runners (like windows-latest, windows-2022, windows-2019) are all 64-bit Windows Server VMs.
68374+ }
68375+ async installCli() {
68376+ const downloadUrl = this.downloadUrl();
68377+ await super.install(downloadUrl);
68378+ }
68379+ downloadUrl() {
68380+ return `https://cache.agilebits.com/dist/1P/op2/pkg/${this.version}/op_windows_${this.arch}_${this.version}.zip`;
68381+ }
68382+ }
68383+
68384+ ;// CONCATENATED MODULE: ./src/cli-installer/index.ts
68385+
68386+
68387+
68388+ // Defines the architecture of the runner executing the job.
68389+ // Look `RUNNER_ARCH` for possible values (https://docs.github.com/en/actions/reference/variables-reference).
68390+ var RunnerArch;
68391+ (function (RunnerArch) {
68392+ RunnerArch["X64"] = "X64";
68393+ RunnerArch["X86"] = "X86";
68394+ RunnerArch["ARM"] = "ARM";
68395+ RunnerArch["ARM64"] = "ARM64";
68396+ })(RunnerArch || (RunnerArch = {}));
68397+ // RunnerOS defines the operating system of the runner executing the job.
68398+ // Look `RUNNER_OS` for possible values (https://docs.github.com/en/actions/reference/variables-reference).
68399+ var RunnerOS;
68400+ (function (RunnerOS) {
68401+ RunnerOS["Linux"] = "Linux";
68402+ RunnerOS["MacOS"] = "macOS";
68403+ RunnerOS["Windows"] = "Windows";
68404+ })(RunnerOS || (RunnerOS = {}));
68405+
6832368406// EXTERNAL MODULE: ./node_modules/semver/index.js
6832468407var semver = __nccwpck_require__(2088);
6832568408var semver_default = /*#__PURE__*/__nccwpck_require__.n(semver);
@@ -88219,114 +88302,6 @@ class VersionResolver {
8821988302
8822088303
8822188304
88222- ;// CONCATENATED MODULE: ./src/cli-installer/macos.ts
88223-
88224-
88225-
88226-
88227-
88228-
88229-
88230-
88231-
88232-
88233- const execAsync = (0,external_util_.promisify)(external_child_process_.exec);
88234- class MacOSInstaller extends CliInstaller {
88235- arch;
88236- version;
88237- minVersionWithMacOSZipInstaller = "2.20.0";
88238- constructor(version) {
88239- super();
88240- this.version = version;
88241- this.arch = this.getArch();
88242- }
88243- async installCli() {
88244- const downloadUrl = this.downloadUrl();
88245- core.info(`Downloading 1Password CLI ${this.version} from ${downloadUrl}`);
88246- await this.installOnMacOS(downloadUrl);
88247- }
88248- downloadUrl() {
88249- // For versions before 2.20.0, use the .pkg installer
88250- if (semver_default().lt(normalizeForSemver(this.version), this.minVersionWithMacOSZipInstaller)) {
88251- return `https://cache.agilebits.com/dist/1P/op2/pkg/${this.version}/op_apple_universal_${this.version}.pkg`;
88252- }
88253- return `https://cache.agilebits.com/dist/1P/op2/pkg/${this.version}/op_darwin_${this.arch}_${this.version}.zip`;
88254- }
88255- getArch() {
88256- switch (process.env.RUNNER_ARCH) {
88257- case RunnerArch.X64:
88258- return "amd64";
88259- case RunnerArch.ARM64:
88260- return "arm64";
88261- default:
88262- throw new Error(`Unsupported RUNNER_ARCH value for macOS: ${process.env.RUNNER_ARCH}`);
88263- }
88264- }
88265- // CLI releases <2.20.0 doesn't support `.zip` files, and uses `.pkg` files instead,
88266- // Need to overwrite this to not introduce breaking changes.
88267- async installOnMacOS(downloadUrl) {
88268- if (semver_default().gte(normalizeForSemver(this.version), this.minVersionWithMacOSZipInstaller)) {
88269- await super.install(downloadUrl);
88270- return;
88271- }
88272- core.info("Installing 1Password CLI using MacOS .pkg installer");
88273- const pkgPath = await tool_cache.downloadTool(downloadUrl);
88274- // Renaming to .pkg extension
88275- const pkgWithExtension = `${pkgPath}.pkg`;
88276- external_fs_.renameSync(pkgPath, pkgWithExtension);
88277- const expandDir = "temp-pkg";
88278- await execAsync(`pkgutil --expand "${pkgWithExtension}" "${expandDir}"`);
88279- const payloadPath = external_path_.join(expandDir, "op.pkg", "Payload");
88280- const cliPath = await tool_cache.extractTar(payloadPath);
88281- core.info(`Extracted CLI to '${cliPath}'`);
88282- core.addPath(cliPath);
88283- external_fs_.rmSync(expandDir, { recursive: true, force: true });
88284- external_fs_.rmSync(pkgPath, { force: true });
88285- core.info("1Password CLI installed from MacOS .pkg");
88286- }
88287- }
88288-
88289- ;// CONCATENATED MODULE: ./src/cli-installer/windows.ts
88290-
88291- class WindowsInstaller extends CliInstaller {
88292- arch;
88293- version;
88294- constructor(version) {
88295- super();
88296- this.version = version;
88297- this.arch = "amd64"; // GitHub-hosted Windows runners (like windows-latest, windows-2022, windows-2019) are all 64-bit Windows Server VMs.
88298- }
88299- async installCli() {
88300- const downloadUrl = this.downloadUrl();
88301- await super.install(downloadUrl);
88302- }
88303- downloadUrl() {
88304- return `https://cache.agilebits.com/dist/1P/op2/pkg/${this.version}/op_windows_${this.arch}_${this.version}.zip`;
88305- }
88306- }
88307-
88308- ;// CONCATENATED MODULE: ./src/cli-installer/index.ts
88309-
88310-
88311-
88312- // Defines the architecture of the runner executing the job.
88313- // Look `RUNNER_ARCH` for possible values (https://docs.github.com/en/actions/reference/variables-reference).
88314- var RunnerArch;
88315- (function (RunnerArch) {
88316- RunnerArch["X64"] = "X64";
88317- RunnerArch["X86"] = "X86";
88318- RunnerArch["ARM"] = "ARM";
88319- RunnerArch["ARM64"] = "ARM64";
88320- })(RunnerArch || (RunnerArch = {}));
88321- // RunnerOS defines the operating system of the runner executing the job.
88322- // Look `RUNNER_OS` for possible values (https://docs.github.com/en/actions/reference/variables-reference).
88323- var RunnerOS;
88324- (function (RunnerOS) {
88325- RunnerOS["Linux"] = "Linux";
88326- RunnerOS["MacOS"] = "macOS";
88327- RunnerOS["Windows"] = "Windows";
88328- })(RunnerOS || (RunnerOS = {}));
88329-
8833088305;// CONCATENATED MODULE: ./src/index.ts
8833188306
8833288307
0 commit comments