mirror of
https://gitea.com/actions/setup-android.git
synced 2025-12-23 15:39:52 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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:
|
||||
- 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
|
||||
|
||||
|
||||
15
README.md
15
README.md
@@ -3,9 +3,18 @@
|
||||

|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
984
dist/index.js
vendored
984
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
5106
package-lock.json
generated
5106
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
@@ -25,26 +25,26 @@
|
||||
"author": "daveol",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^2.0.2",
|
||||
"@actions/cache": "^3.0.0",
|
||||
"@actions/core": "^1.3.0",
|
||||
"@actions/tool-cache": "^1.6.1",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"fs-extra": "^10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^9.0.11",
|
||||
"@types/jest": "^27.4.1",
|
||||
"@types/node": "^17.0.25",
|
||||
"@types/jest": "^28.1.6",
|
||||
"@types/node": "^16.11.47",
|
||||
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
||||
"@typescript-eslint/parser": "^5.20.0",
|
||||
"@vercel/ncc": "^0.33.4",
|
||||
"@vercel/ncc": "^0.34.0",
|
||||
"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",
|
||||
"jest": "^28.1.3",
|
||||
"jest-circus": "^28.1.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
"prettier": "^2.3.0",
|
||||
"ts-jest": "^27.1.4",
|
||||
"ts-jest": "^28.0.7",
|
||||
"typescript": "^4.2.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 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 = ''
|
||||
|
||||
Reference in New Issue
Block a user