mirror of
https://github.com/android-actions/setup-android.git
synced 2026-06-12 13:28:06 +00:00
Compare commits
52 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 13f81365a4 | |||
| 110787489d | |||
| 4ba30747dc | |||
| a3da945276 | |||
| 1cb03f027b | |||
| ccc0939481 | |||
| fabcc053ca | |||
| bee5ac3f90 | |||
| 26c86ac3f5 | |||
| bc52f43eb3 | |||
| 899d70efad | |||
| 7c5672355a | |||
| be14762587 | |||
| 02a4c0fae6 | |||
| 4963c9b31a | |||
| 2741e25473 | |||
| ed89994087 | |||
| 240c9729bd | |||
| 36d0d24ca4 | |||
| cabf29c9ef | |||
| 65b8c7bc99 | |||
| 34f33aad26 | |||
| 3d201fcd51 | |||
| 1ba064a8a2 | |||
| 4360e92aa0 | |||
| 88c04cbb34 | |||
| 239c6f5c7c | |||
| 882b1d3cd5 | |||
| 00dbb341f0 | |||
| c1ac9c4be4 | |||
| 0f0da39d59 | |||
| c6c2260dde | |||
| 47ea489789 | |||
| 244317f5bb | |||
| 5440ded976 | |||
| e94bbf69b5 | |||
| 98f14d164f | |||
| f56c207000 | |||
| a7d36b05d1 | |||
| 20bad8a341 | |||
| fc91ea75c1 | |||
| 1685c3d866 | |||
| 62d9713f6c | |||
| e2a3af499e | |||
| c83cf2fad5 | |||
| 39db4a222a | |||
| 69e42af51e | |||
| 1eccbc5efd | |||
| 54a403b145 | |||
| 4bd635e9b7 | |||
| 7528b5330e | |||
| c1a2a96971 |
@@ -44,6 +44,7 @@
|
|||||||
"semi": "off",
|
"semi": "off",
|
||||||
"@typescript-eslint/semi": ["error", "never"],
|
"@typescript-eslint/semi": ["error", "never"],
|
||||||
"@typescript-eslint/type-annotation-spacing": "error",
|
"@typescript-eslint/type-annotation-spacing": "error",
|
||||||
|
"i18n-text/no-en": "warn",
|
||||||
"@typescript-eslint/unbound-method": "error"
|
"@typescript-eslint/unbound-method": "error"
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
|
|||||||
@@ -15,26 +15,29 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup node 12
|
- name: Setup node 20
|
||||||
uses: actions/setup-node@v2.1.5
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: 20
|
||||||
|
|
||||||
- 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@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup node 12
|
- name: Setup node 20
|
||||||
uses: actions/setup-node@v2.1.5
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: 20
|
||||||
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
@@ -43,12 +46,12 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup node 12
|
- name: Setup node 20
|
||||||
uses: actions/setup-node@v2.1.5
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: 20
|
||||||
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
@@ -59,15 +62,21 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2016, windows-2019 ]
|
os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, windows-2019, windows-2022 ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup node 12
|
- name: Setup node 20
|
||||||
uses: actions/setup-node@v2.1.5
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: 20
|
||||||
|
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
java-version: 17
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
@@ -79,12 +88,12 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup node 12
|
- name: Setup node 20
|
||||||
uses: actions/setup-node@v2.1.5
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: 20
|
||||||
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
# For most projects, this workflow file will not need changing; you simply need
|
||||||
|
# to commit it to your repository.
|
||||||
|
#
|
||||||
|
# You may wish to alter this file to override the set of languages analyzed,
|
||||||
|
# or to provide custom queries or build logic.
|
||||||
|
#
|
||||||
|
# ******** NOTE ********
|
||||||
|
# We have attempted to detect the languages in your repository. Please check
|
||||||
|
# the `language` matrix defined below to confirm you have the correct set of
|
||||||
|
# supported CodeQL languages.
|
||||||
|
#
|
||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [ main ]
|
||||||
|
schedule:
|
||||||
|
- cron: '44 12 * * 4'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: 'javascript'
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
@@ -22,19 +22,24 @@ jobs:
|
|||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- windows-latest
|
- windows-latest
|
||||||
- macos-latest
|
- macos-latest
|
||||||
|
|
||||||
|
# Disabled, because daveol/SampleApplication is missing
|
||||||
|
if: ${{ false }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
repository: daveol/SampleApplication
|
repository: daveol/SampleApplication
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
path: ./build/
|
path: ./build/
|
||||||
|
|
||||||
- name: Set up JDK 1.8
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 17
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
- name: Setup Android SDK
|
- name: Setup Android SDK
|
||||||
id: 'setup-android'
|
id: 'setup-android'
|
||||||
|
|||||||
@@ -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 (11.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/11.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
|
||||||
|
|
||||||
@@ -14,12 +23,13 @@ See [action.yml](action.yml)
|
|||||||
## Basic
|
## Basic
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up JDK 1.8
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
- name: Setup Android SDK
|
- name: Setup Android SDK
|
||||||
uses: android-actions/setup-android@v2
|
uses: android-actions/setup-android@v2
|
||||||
|
|||||||
+1
-1
@@ -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: node20
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
|
|||||||
Vendored
+4989
-3668
File diff suppressed because it is too large
Load Diff
Generated
+10530
-7189
File diff suppressed because it is too large
Load Diff
+18
-18
@@ -25,26 +25,26 @@
|
|||||||
"author": "daveol",
|
"author": "daveol",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^1.0.7",
|
"@actions/cache": "^3.2.2",
|
||||||
"@actions/core": "^1.3.0",
|
"@actions/core": "^1.10.1",
|
||||||
"@actions/tool-cache": "^1.6.1",
|
"@actions/tool-cache": "^2.0.1",
|
||||||
"fs-extra": "^9.1.0"
|
"fs-extra": "^11.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/fs-extra": "^9.0.11",
|
"@types/fs-extra": "^11.0.2",
|
||||||
"@types/jest": "^26.0.23",
|
"@types/jest": "^29.5.5",
|
||||||
"@types/node": "^14.17.1",
|
"@types/node": "^20.6.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.25.0",
|
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
||||||
"@typescript-eslint/parser": "^4.25.0",
|
"@typescript-eslint/parser": "^6.7.2",
|
||||||
"@vercel/ncc": "^0.27.0",
|
"@vercel/ncc": "^0.38.0",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.50.0",
|
||||||
"eslint-plugin-github": "^4.1.3",
|
"eslint-plugin-github": "^4.10.0",
|
||||||
"eslint-plugin-jest": "^24.3.6",
|
"eslint-plugin-jest": "^27.4.0",
|
||||||
"jest": "^26.6.3",
|
"jest": "^29.7.0",
|
||||||
"jest-circus": "^26.6.3",
|
"jest-circus": "^29.7.0",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"prettier": "^2.3.0",
|
"prettier": "^3.0.3",
|
||||||
"ts-jest": "^26.5.6",
|
"ts-jest": "^29.1.1",
|
||||||
"typescript": "^4.2.4"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-2
@@ -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 = '3.0'
|
const CMDLINE_TOOLS_VERSION = '11.0'
|
||||||
const COMMANDLINE_TOOLS_VERSION = '6858069'
|
const COMMANDLINE_TOOLS_VERSION = '10406996'
|
||||||
|
|
||||||
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 = ''
|
||||||
|
|||||||
+2
-1
@@ -6,7 +6,8 @@
|
|||||||
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||||
"strict": true, /* Enable all strict type-checking options. */
|
"strict": true, /* Enable all strict type-checking options. */
|
||||||
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
||||||
|
"moduleResolution": "node"
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "**/*.test.ts"]
|
"exclude": ["node_modules", "**/*.test.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user