Visitar URL original
Add version 15859902 (22.0), default it and update macOS url for it. · android-actions/setup-android@1f87d5b · GitHub
Skip to content

Commit 1f87d5b

Browse files
Add version 15859902 (22.0), default it and update macOS url for it.
1 parent 138b5fb commit 1f87d5b

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

‎action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
cmdline-tools-version:
77
description: 'cmdline-tools-version. See https://developer.android.com/studio#command-line-tools-only'
88
required: false
9-
default: '14742923'
9+
default: '15859902'
1010

1111
accept-android-sdk-licenses:
1212
description: 'Android SDK is usable only after the license agreement. Should setup-android agree to the licences, provided by "sdkmanager --licenses"'

‎dist/index.js‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23152,6 +23152,8 @@ var fs4 = __toESM(require("fs"));
2315223152
var os6 = __toESM(require("os"));
2315323153
function getVersionShort(versionLong) {
2315423154
switch (versionLong) {
23155+
case "15859902":
23156+
return "22.0";
2315523157
case "14742923":
2315623158
return "20.0";
2315723159
case "12266719":
@@ -23184,6 +23186,7 @@ if (VERSION_LONG.includes("/") || VERSION_LONG.includes("\\")) {
2318423186
var VERSION_SHORT = getVersionShort(VERSION_LONG);
2318523187
var COMMANDLINE_TOOLS_WIN_URL = `https://dl.google.com/android/repository/commandlinetools-win-${VERSION_LONG}_latest.zip`;
2318623188
var COMMANDLINE_TOOLS_MAC_URL = `https://dl.google.com/android/repository/commandlinetools-mac-${VERSION_LONG}_latest.zip`;
23189+
var COMMANDLINE_TOOLS_MAC_ARM64_URL = `https://dl.google.com/android/repository/commandlinetools-mac_arm64-${VERSION_LONG}_latest.zip`;
2318723190
var COMMANDLINE_TOOLS_LIN_URL = `https://dl.google.com/android/repository/commandlinetools-linux-${VERSION_LONG}_latest.zip`;
2318823191
var ANDROID_HOME_SDK_DIR = path6.join(os6.homedir(), ".android", "sdk");
2318923192
var ANDROID_SDK_ROOT = process.env["ANDROID_SDK_ROOT"] || ANDROID_HOME_SDK_DIR;
@@ -23218,7 +23221,11 @@ async function installSdkManager() {
2321823221
if (process.platform === "linux") {
2321923222
cmdlineToolsURL = COMMANDLINE_TOOLS_LIN_URL;
2322023223
} else if (process.platform === "darwin") {
23221-
cmdlineToolsURL = COMMANDLINE_TOOLS_MAC_URL;
23224+
if (Number(VERSION_LONG) >= 15859902) {
23225+
cmdlineToolsURL = COMMANDLINE_TOOLS_MAC_ARM64_URL;
23226+
} else {
23227+
cmdlineToolsURL = COMMANDLINE_TOOLS_MAC_URL;
23228+
}
2322223229
} else if (process.platform === "win32") {
2322323230
cmdlineToolsURL = COMMANDLINE_TOOLS_WIN_URL;
2322423231
} else {

‎src/main.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import * as os from 'os'
77

88
function getVersionShort(versionLong: string): string {
99
switch (versionLong) {
10+
case '15859902':
11+
return '22.0'
1012
case '14742923':
1113
return '20.0'
1214
case '12266719':
@@ -41,6 +43,7 @@ const VERSION_SHORT = getVersionShort(VERSION_LONG)
4143

4244
const COMMANDLINE_TOOLS_WIN_URL = `https://dl.google.com/android/repository/commandlinetools-win-${VERSION_LONG}_latest.zip`
4345
const COMMANDLINE_TOOLS_MAC_URL = `https://dl.google.com/android/repository/commandlinetools-mac-${VERSION_LONG}_latest.zip`
46+
const COMMANDLINE_TOOLS_MAC_ARM64_URL = `https://dl.google.com/android/repository/commandlinetools-mac_arm64-${VERSION_LONG}_latest.zip`
4447
const COMMANDLINE_TOOLS_LIN_URL = `https://dl.google.com/android/repository/commandlinetools-linux-${VERSION_LONG}_latest.zip`
4548

4649
const ANDROID_HOME_SDK_DIR = path.join(os.homedir(), '.android', 'sdk')
@@ -105,7 +108,11 @@ async function installSdkManager(): Promise<string> {
105108
if (process.platform === 'linux') {
106109
cmdlineToolsURL = COMMANDLINE_TOOLS_LIN_URL
107110
} else if (process.platform === 'darwin') {
108-
cmdlineToolsURL = COMMANDLINE_TOOLS_MAC_URL
111+
if (Number(VERSION_LONG) >= 15859902) {
112+
cmdlineToolsURL = COMMANDLINE_TOOLS_MAC_ARM64_URL
113+
} else {
114+
cmdlineToolsURL = COMMANDLINE_TOOLS_MAC_URL
115+
}
109116
} else if (process.platform === 'win32') {
110117
cmdlineToolsURL = COMMANDLINE_TOOLS_WIN_URL
111118
} else {

0 commit comments

Comments
 (0)