Skip to content

Commit

Permalink
[Issue #192] Accept cmdline-tools-version input parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Nov 21, 2023
1 parent 9584f05 commit 8023252
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 3,125 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ jobs:
- run: npm run build

- run: node dist/index.js
env:
INPUT_CMDLINE-TOOLS-VERSION: '10406996'

- run: sdkmanager --list

Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,31 @@ steps:
run: ./gradlew --no-daemon build
```
## SDK Version selection
Command line tools are versioned using two variables - short and long.
Long one is the build number, used in the zip URL, short one is the human friendly version name.
By default, setup-android installs version 10406996 (short version 11.0).
To install a different version, call setup-android with desired long version as the input parameter `cmdline-tools-version`:
```yaml
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
cmdline-tools-version: 8512546
```

#### Version table
| Short version | Long version |
| --- | --- |
| 11.0 | 10406996 |
| 10.0 | 9862592 |
| 9.0 | 9477386 |
| 8.0 | 9123335 |
| 7.0 | 8512546 |

Current cmdline tools version can be found at https://developer.android.com/studio#command-line-tools-only

# Thanks
Based on the project [android-problem-matchers-action](https://github.com/jonasb/android-problem-matchers-action) from [@jonasb](https://github.com/jonasb)
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: 'Setup Android SDK Tools'
author: 'Android-Actions'
description: 'Setup the Android SDK Tools and add them to the path'

inputs:
cmdline-tools-version:
description: 'cmdline-tools-version. See https://developer.android.com/studio#command-line-tools-only'
required: false
default: '10406996'

runs:
using: node20
main: 'dist/index.js'
Expand Down
Loading

0 comments on commit 8023252

Please sign in to comment.