diff --git a/docs/generate.md b/docs/generate.md index 78179f0e..eee891b5 100644 --- a/docs/generate.md +++ b/docs/generate.md @@ -2,9 +2,10 @@ Generate a new CLI -- [`oclif generate NAME`](#oclif-generate-name) -- [`oclif generate command NAME`](#oclif-generate-command-name) -- [`oclif generate hook NAME`](#oclif-generate-hook-name) +- [`oclif generate`](#oclif-generate) + - [`oclif generate NAME`](#oclif-generate-name) + - [`oclif generate command NAME`](#oclif-generate-command-name) + - [`oclif generate hook NAME`](#oclif-generate-hook-name) ## `oclif generate NAME` diff --git a/docs/init.md b/docs/init.md index ecfe1031..f6ae8c53 100644 --- a/docs/init.md +++ b/docs/init.md @@ -3,6 +3,7 @@ Initialize a new oclif CLI - [`oclif init`](#oclif-init) + - [`oclif init`](#oclif-init-1) ## `oclif init` diff --git a/docs/manifest.md b/docs/manifest.md index 3129ed9a..b9bc1e0e 100644 --- a/docs/manifest.md +++ b/docs/manifest.md @@ -2,7 +2,8 @@ Generates plugin manifest json (oclif.manifest.json). -- [`oclif manifest [PATH]`](#oclif-manifest-path) +- [`oclif manifest`](#oclif-manifest) + - [`oclif manifest [PATH]`](#oclif-manifest-path) ## `oclif manifest [PATH]` diff --git a/docs/pack.md b/docs/pack.md index 18011159..db81357a 100644 --- a/docs/pack.md +++ b/docs/pack.md @@ -2,10 +2,11 @@ Package an oclif CLI into installable artifacts. -- [`oclif pack deb`](#oclif-pack-deb) -- [`oclif pack macos`](#oclif-pack-macos) -- [`oclif pack tarballs`](#oclif-pack-tarballs) -- [`oclif pack win`](#oclif-pack-win) +- [`oclif pack`](#oclif-pack) + - [`oclif pack deb`](#oclif-pack-deb) + - [`oclif pack macos`](#oclif-pack-macos) + - [`oclif pack tarballs`](#oclif-pack-tarballs) + - [`oclif pack win`](#oclif-pack-win) ## `oclif pack deb` @@ -99,7 +100,7 @@ FLAGS checkbox. Set to "hidden" to hide the option (will let defender do its thing). --prune-lockfiles remove lockfiles in the tarball. - --targets= Comma-separated targets to pack (e.g.: win32-x64,win32-x86). + --targets= Comma-separated targets to pack (e.g.: win32-x64,win32-x86,win32-arm64). DESCRIPTION Create windows installer from oclif CLI diff --git a/docs/promote.md b/docs/promote.md index 2ab6cf5a..25e47164 100644 --- a/docs/promote.md +++ b/docs/promote.md @@ -3,6 +3,7 @@ Promote CLI builds to a S3 release channel. - [`oclif promote`](#oclif-promote) + - [`oclif promote`](#oclif-promote-1) ## `oclif promote` diff --git a/docs/readme.md b/docs/readme.md index 90faea3e..b64bc04c 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -3,6 +3,7 @@ Adds commands to README.md in current directory. - [`oclif readme`](#oclif-readme) + - [`oclif readme`](#oclif-readme-1) ## `oclif readme` diff --git a/docs/upload.md b/docs/upload.md index 9ee309c6..3fe4951a 100644 --- a/docs/upload.md +++ b/docs/upload.md @@ -2,10 +2,11 @@ Upload installable CLI artifacts to AWS S3. -- [`oclif upload deb`](#oclif-upload-deb) -- [`oclif upload macos`](#oclif-upload-macos) -- [`oclif upload tarballs`](#oclif-upload-tarballs) -- [`oclif upload win`](#oclif-upload-win) +- [`oclif upload`](#oclif-upload) + - [`oclif upload deb`](#oclif-upload-deb) + - [`oclif upload macos`](#oclif-upload-macos) + - [`oclif upload tarballs`](#oclif-upload-tarballs) + - [`oclif upload win`](#oclif-upload-win) ## `oclif upload deb` @@ -71,7 +72,7 @@ USAGE FLAGS -r, --root= (required) [default: .] Path to oclif CLI root. - --targets= Comma-separated targets to pack (e.g.: win32-x64,win32-x86). + --targets= Comma-separated targets to pack (e.g.: win32-x64,win32-x86,win32-arm64). DESCRIPTION Upload windows installers built with `pack win`. diff --git a/src/commands/pack/win.ts b/src/commands/pack/win.ts index 6ab2d85a..698e5f0a 100644 --- a/src/commands/pack/win.ts +++ b/src/commands/pack/win.ts @@ -259,7 +259,7 @@ the CLI should already exist in a directory named after the CLI that is the root required: false, }), targets: Flags.string({ - description: 'Comma-separated targets to pack (e.g.: win32-x64,win32-x86).', + description: 'Comma-separated targets to pack (e.g.: win32-x64,win32-x86,win32-arm64).', }), } diff --git a/src/commands/upload/win.ts b/src/commands/upload/win.ts index 747e8cc4..93207f26 100644 --- a/src/commands/upload/win.ts +++ b/src/commands/upload/win.ts @@ -11,7 +11,7 @@ export default class UploadWin extends Command { static flags = { root: Flags.string({char: 'r', default: '.', description: 'Path to oclif CLI root.', required: true}), - targets: Flags.string({description: 'Comma-separated targets to pack (e.g.: win32-x64,win32-x86).'}), + targets: Flags.string({description: 'Comma-separated targets to pack (e.g.: win32-x64,win32-x86,win32-arm64).'}), } async run(): Promise { @@ -40,7 +40,7 @@ export default class UploadWin extends Command { } const cloudKeyBase = commitAWSDir(config.pjson.version, buildConfig.gitSha, s3Config) - const uploadWin = async (arch: 'x64' | 'x86') => { + const uploadWin = async (arch: 'arm64' | 'x64' | 'x86') => { const templateKey = templateShortKey('win32', { arch, bin: config.bin, @@ -53,7 +53,7 @@ export default class UploadWin extends Command { await aws.s3.uploadFile(localExe, {...S3Options, CacheControl: 'max-age=86400', Key: cloudKey}) } - await Promise.all([uploadWin('x64'), uploadWin('x86')]) + await Promise.all([uploadWin('x64'), uploadWin('x86'), uploadWin('arm64')]) log(`done uploading windows executables for v${config.version}-${buildConfig.gitSha}`) } diff --git a/src/tarballs/build.ts b/src/tarballs/build.ts index 7b28569a..a686699b 100644 --- a/src/tarballs/build.ts +++ b/src/tarballs/build.ts @@ -6,6 +6,7 @@ import {existsSync} from 'node:fs' import {mkdir, readdir, rm} from 'node:fs/promises' import * as path from 'node:path' import {promisify} from 'node:util' +import {lt} from 'semver' import {log} from '../log' import {commitAWSDir, templateShortKey} from '../upload-util' @@ -214,6 +215,11 @@ const buildTarget = async ( c: BuildConfig, options: BuildOptions, ) => { + if (target.platform === 'win32' && target.arch === 'arm64' && lt(c.nodeVersion, '20.0.0')) { + ux.warn('win32-arm64 is only supported for node >=20.0.0. Skipping...') + return + } + const workspace = c.workspace(target) const {arch, platform} = target const {bin, version} = c.config diff --git a/src/tarballs/config.ts b/src/tarballs/config.ts index 4ed76354..d61c7116 100644 --- a/src/tarballs/config.ts +++ b/src/tarballs/config.ts @@ -10,7 +10,16 @@ import {templateShortKey} from '../upload-util' import {castArray, compact} from '../util' const exec = promisify(execSync) -export const TARGETS = ['linux-x64', 'linux-arm', 'linux-arm64', 'win32-x64', 'win32-x86', 'darwin-x64', 'darwin-arm64'] +export const TARGETS = [ + 'linux-x64', + 'linux-arm', + 'linux-arm64', + 'win32-x64', + 'win32-x86', + 'win32-arm64', + 'darwin-x64', + 'darwin-arm64', +] export type S3Config = { acl?: ObjectCannedACL diff --git a/src/tarballs/node.ts b/src/tarballs/node.ts index 6f0d2587..e2e56271 100644 --- a/src/tarballs/node.ts +++ b/src/tarballs/node.ts @@ -40,7 +40,7 @@ export async function fetchNodeBinary({arch, nodeVersion, output, platform, tmp} if (platform === 'win32') cache += '.exe' const download = async () => { - log(`downloading ${nodeBase}`) + log(`downloading ${nodeBase} (${url})`) await Promise.all([ensureDir(path.join(tmp, 'cache', nodeVersion)), ensureDir(path.join(tmp, 'node'))]) const shasums = path.join(tmp, 'cache', nodeVersion, 'SHASUMS256.txt.asc') const {default: got} = await import('got')