Skip to content

Commit 8023252

Browse files
[Issue #192] Accept cmdline-tools-version input parameter
1 parent 9584f05 commit 8023252

File tree

7 files changed

+181
-3125
lines changed

7 files changed

+181
-3125
lines changed

.github/workflows/build-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ jobs:
8282
- run: npm run build
8383

8484
- run: node dist/index.js
85+
env:
86+
INPUT_CMDLINE-TOOLS-VERSION: '10406996'
8587

8688
- run: sdkmanager --list
8789

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,31 @@ steps:
3838
run: ./gradlew --no-daemon build
3939
```
4040
41+
## SDK Version selection
42+
43+
Command line tools are versioned using two variables - short and long.
44+
Long one is the build number, used in the zip URL, short one is the human friendly version name.
45+
46+
By default, setup-android installs version 10406996 (short version 11.0).
47+
48+
To install a different version, call setup-android with desired long version as the input parameter `cmdline-tools-version`:
49+
```yaml
50+
- name: Setup Android SDK
51+
uses: android-actions/setup-android@v3
52+
with:
53+
cmdline-tools-version: 8512546
54+
```
55+
56+
#### Version table
57+
| Short version | Long version |
58+
| --- | --- |
59+
| 11.0 | 10406996 |
60+
| 10.0 | 9862592 |
61+
| 9.0 | 9477386 |
62+
| 8.0 | 9123335 |
63+
| 7.0 | 8512546 |
64+
65+
Current cmdline tools version can be found at https://developer.android.com/studio#command-line-tools-only
4166

4267
# Thanks
4368
Based on the project [android-problem-matchers-action](https://github.com/jonasb/android-problem-matchers-action) from [@jonasb](https://github.com/jonasb)

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: 'Setup Android SDK Tools'
22
author: 'Android-Actions'
33
description: 'Setup the Android SDK Tools and add them to the path'
44

5+
inputs:
6+
cmdline-tools-version:
7+
description: 'cmdline-tools-version. See https://developer.android.com/studio#command-line-tools-only'
8+
required: false
9+
default: '10406996'
10+
511
runs:
612
using: node20
713
main: 'dist/index.js'

0 commit comments

Comments
 (0)