mirror of
https://gitea.com/actions/setup-android.git
synced 2025-12-26 00:48:21 +00:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c5672355a | ||
|
|
be14762587 | ||
|
|
02a4c0fae6 | ||
|
|
4963c9b31a | ||
|
|
2741e25473 | ||
|
|
ed89994087 | ||
|
|
240c9729bd | ||
|
|
36d0d24ca4 | ||
|
|
cabf29c9ef | ||
|
|
65b8c7bc99 | ||
|
|
34f33aad26 | ||
|
|
3d201fcd51 | ||
|
|
1ba064a8a2 | ||
|
|
4360e92aa0 | ||
|
|
88c04cbb34 | ||
|
|
239c6f5c7c | ||
|
|
882b1d3cd5 | ||
|
|
00dbb341f0 | ||
|
|
c1ac9c4be4 | ||
|
|
0f0da39d59 | ||
|
|
c6c2260dde |
25
.github/workflows/build-test.yml
vendored
25
.github/workflows/build-test.yml
vendored
@@ -17,24 +17,27 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup node 12
|
- name: Setup node 16
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: '16'
|
||||||
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
- run: npm run build
|
- 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:
|
format-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup node 12
|
- name: Setup node 16
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: '16'
|
||||||
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
@@ -45,10 +48,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup node 12
|
- name: Setup node 16
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: '16'
|
||||||
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
@@ -59,15 +62,15 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup node 12
|
- name: Setup node 16
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: '16'
|
||||||
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
@@ -81,10 +84,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup node 12
|
- name: Setup node 16
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: '16'
|
||||||
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
|
|||||||
13
README.md
13
README.md
@@ -3,9 +3,18 @@
|
|||||||

|

|
||||||
|
|
||||||
This action sets up the Android SDK tools by:
|
This action sets up the Android SDK tools by:
|
||||||
- Downloading the SDK commandline tools
|
- 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
|
- 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
|
# Usage
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ author: 'Android-Actions'
|
|||||||
description: 'Setup the Android SDK Tools and add them to the path'
|
description: 'Setup the Android SDK Tools and add them to the path'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node16'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
|
|||||||
1679
dist/index.js
vendored
1679
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
5697
package-lock.json
generated
5697
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
36
package.json
36
package.json
@@ -25,26 +25,26 @@
|
|||||||
"author": "daveol",
|
"author": "daveol",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^2.0.2",
|
"@actions/cache": "^3.0.5",
|
||||||
"@actions/core": "^1.3.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/tool-cache": "^1.6.1",
|
"@actions/tool-cache": "^2.0.1",
|
||||||
"fs-extra": "^10.0.0"
|
"fs-extra": "^10.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/fs-extra": "^9.0.11",
|
"@types/fs-extra": "^9.0.13",
|
||||||
"@types/jest": "^27.4.1",
|
"@types/jest": "^29.2.0",
|
||||||
"@types/node": "^17.0.25",
|
"@types/node": "^16.11.66",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
"@typescript-eslint/eslint-plugin": "^5.40.1",
|
||||||
"@typescript-eslint/parser": "^5.20.0",
|
"@typescript-eslint/parser": "^5.40.1",
|
||||||
"@vercel/ncc": "^0.33.4",
|
"@vercel/ncc": "^0.34.0",
|
||||||
"eslint": "^8.13.0",
|
"eslint": "^8.25.0",
|
||||||
"eslint-plugin-github": "^4.3.6",
|
"eslint-plugin-github": "^4.4.0",
|
||||||
"eslint-plugin-jest": "^26.1.4",
|
"eslint-plugin-jest": "^27.1.3",
|
||||||
"jest": "^27.5.1",
|
"jest": "^29.2.1",
|
||||||
"jest-circus": "^27.0.6",
|
"jest-circus": "^29.2.1",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"prettier": "^2.3.0",
|
"prettier": "^2.7.1",
|
||||||
"ts-jest": "^27.1.4",
|
"ts-jest": "^29.0.3",
|
||||||
"typescript": "^4.2.4"
|
"typescript": "^4.8.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
15
src/main.ts
15
src/main.ts
@@ -6,8 +6,8 @@ import * as fs from 'fs'
|
|||||||
import * as fse from 'fs-extra'
|
import * as fse from 'fs-extra'
|
||||||
import * as os from 'os'
|
import * as os from 'os'
|
||||||
|
|
||||||
const CMDLINE_TOOLS_VERSION = '6.0'
|
const CMDLINE_TOOLS_VERSION = '7.0'
|
||||||
const COMMANDLINE_TOOLS_VERSION = '8092744'
|
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_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`
|
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.exePath = getSdkManagerPath('latest')
|
||||||
result.isFound = fs.existsSync(result.exePath)
|
result.isFound = fs.existsSync(result.exePath)
|
||||||
if (result.isFound) {
|
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
|
return result
|
||||||
}
|
}
|
||||||
result.exePath = ''
|
result.exePath = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user