21 Commits
v2.0.8 ... v2

Author SHA1 Message Date
Vilius Sutkus '89
7c5672355a Rebuild 2022-10-18 22:49:38 +03:00
Vilius Sutkus '89
be14762587 Update dependencies 2022-10-18 22:48:21 +03:00
dependabot[bot]
02a4c0fae6 Bump @actions/cache from 3.0.0 to 3.0.5
Bumps [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache) from 3.0.0 to 3.0.5.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

---
updated-dependencies:
- dependency-name: "@actions/cache"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-18 22:35:00 +03:00
dependabot[bot]
4963c9b31a Bump @actions/core from 1.9.0 to 1.10.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-18 22:32:16 +03:00
Vilius Sutkus '89
2741e25473 Update README.md 2022-08-03 16:44:44 +03:00
Vilius Sutkus '89
ed89994087 Merge branch 'main' of github.com:android-actions/setup-android 2022-08-03 16:38:34 +03:00
Vilius Sutkus '89
240c9729bd Downgrade @types/node to 16, because we are using node LTS - 16. 2022-08-03 16:14:58 +03:00
Vilius Sutkus '89
36d0d24ca4 Update dependencies 2022-08-03 16:09:19 +03:00
Vilius Sutkus '89
cabf29c9ef [CI] Update "rebuild needed" check 2022-08-03 15:56:56 +03:00
Vilius Sutkus '89
65b8c7bc99 [CI] Add a "rebuild needed" check 2022-08-03 15:27:53 +03:00
Vilius Sutkus '89
34f33aad26 Use Node16 (current LTS), instead of Node12 2022-08-03 15:23:56 +03:00
Vilius Sutkus '89
3d201fcd51 Update cmdline-tools version to 7.0 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
1ba064a8a2 [2/2] Read version of cmdline-tools/latest, if version is correct - use it 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
4360e92aa0 Read version of cmdline-tools/latest, if version is correct - use it 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
88c04cbb34 [CI] Remove macos-10.15, because it is deprecated 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
239c6f5c7c [CI] Update test matrix to include ubuntu-22.04 and macos-12 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
882b1d3cd5 Update cmdline-tools version to 7.0 2022-08-03 15:03:16 +03:00
Vilius Sutkus '89
00dbb341f0 [2/2] Read version of cmdline-tools/latest, if version is correct - use it 2022-08-03 15:02:48 +03:00
Vilius Sutkus '89
c1ac9c4be4 Read version of cmdline-tools/latest, if version is correct - use it 2022-08-03 15:00:44 +03:00
Vilius Sutkus '89
0f0da39d59 [CI] Remove macos-10.15, because it is deprecated 2022-08-03 13:39:25 +03:00
Vilius Sutkus '89
c6c2260dde [CI] Update test matrix to include ubuntu-22.04 and macos-12 2022-08-03 13:36:32 +03:00
7 changed files with 4109 additions and 3360 deletions

View File

@@ -17,24 +17,27 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup node 12
- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '12'
node-version: '16'
- run: npm ci
- run: npm run build
- name: Check if dist/index.js needs to be rebuilt
run: diff <(git status dist/index.js --short) <(echo -n "")
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node 12
- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '12'
node-version: '16'
- run: npm ci
@@ -45,10 +48,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup node 12
- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '12'
node-version: '16'
- run: npm ci
@@ -59,15 +62,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11, windows-2019, windows-2022 ]
os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022 ]
steps:
- uses: actions/checkout@v3
- name: Setup node 12
- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '12'
node-version: '16'
- run: npm ci
- run: npm run build
@@ -81,10 +84,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup node 12
- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '12'
node-version: '16'
- run: npm ci

View File

@@ -3,9 +3,18 @@
![Build & Test](https://github.com/android-actions/setup-android/workflows/Build%20&%20Test/badge.svg)
This action sets up the Android SDK tools by:
- Downloading the SDK commandline tools
- Accepting the SDK licenses
- Downloading the SDK commandline tools, if the current version (7.0) is not found in either `$ANDROID_SDK_ROOT` or `$HOME/.android/sdk`.
- Accepting the SDK licenses.
- Installing `tools` and `platform-tools`.
- Adding `platform-tools` (contains adb) and `cmdline-tools/7.0/bin` (contains sdkmanager) to `$PATH`.
- Setting up problem [matchers](/matchers.json).
On Windows 2016 runners, this action also checks if `$ANDROID_SDK_ROOT` path contains spaces.
If it does - it moves SDK to a path without spaces. This is needed because spaces are highly problematic:
```
C:\windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Android\android-sdk\cmdline-tools\3.0\bin\sdkmanager.bat" --licenses"
Error: Could not find or load main class Files
```
# Usage

View File

@@ -3,7 +3,7 @@ author: 'Android-Actions'
description: 'Setup the Android SDK Tools and add them to the path'
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
branding:

1679
dist/index.js vendored

File diff suppressed because it is too large Load Diff

5697
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -25,26 +25,26 @@
"author": "daveol",
"license": "ISC",
"dependencies": {
"@actions/cache": "^2.0.2",
"@actions/core": "^1.3.0",
"@actions/tool-cache": "^1.6.1",
"fs-extra": "^10.0.0"
"@actions/cache": "^3.0.5",
"@actions/core": "^1.10.0",
"@actions/tool-cache": "^2.0.1",
"fs-extra": "^10.1.0"
},
"devDependencies": {
"@types/fs-extra": "^9.0.11",
"@types/jest": "^27.4.1",
"@types/node": "^17.0.25",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"@vercel/ncc": "^0.33.4",
"eslint": "^8.13.0",
"eslint-plugin-github": "^4.3.6",
"eslint-plugin-jest": "^26.1.4",
"jest": "^27.5.1",
"jest-circus": "^27.0.6",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^29.2.0",
"@types/node": "^16.11.66",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"@vercel/ncc": "^0.34.0",
"eslint": "^8.25.0",
"eslint-plugin-github": "^4.4.0",
"eslint-plugin-jest": "^27.1.3",
"jest": "^29.2.1",
"jest-circus": "^29.2.1",
"js-yaml": "^4.1.0",
"prettier": "^2.3.0",
"ts-jest": "^27.1.4",
"typescript": "^4.2.4"
"prettier": "^2.7.1",
"ts-jest": "^29.0.3",
"typescript": "^4.8.4"
}
}

View File

@@ -6,8 +6,8 @@ import * as fs from 'fs'
import * as fse from 'fs-extra'
import * as os from 'os'
const CMDLINE_TOOLS_VERSION = '6.0'
const COMMANDLINE_TOOLS_VERSION = '8092744'
const CMDLINE_TOOLS_VERSION = '7.0'
const COMMANDLINE_TOOLS_VERSION = '8512546'
const COMMANDLINE_TOOLS_WIN_URL = `https://dl.google.com/android/repository/commandlinetools-win-${COMMANDLINE_TOOLS_VERSION}_latest.zip`
const COMMANDLINE_TOOLS_MAC_URL = `https://dl.google.com/android/repository/commandlinetools-mac-${COMMANDLINE_TOOLS_VERSION}_latest.zip`
@@ -48,6 +48,17 @@ function findPreinstalledSdkManager(): {
result.exePath = getSdkManagerPath('latest')
result.isFound = fs.existsSync(result.exePath)
if (result.isFound) {
const propertiesFile = path.join(
ANDROID_SDK_ROOT,
'cmdline-tools',
'latest',
'source.properties'
)
if (fs.existsSync(propertiesFile)) {
result.isCorrectVersion = fs
.readFileSync(propertiesFile, 'utf8')
.includes(`Pkg.Revision=${CMDLINE_TOOLS_VERSION}`)
}
return result
}
result.exePath = ''