Compare commits

...
Author SHA1 Message Date
dependabot[bot] 8dbf04b386 Bump jest-circus from 30.5.1 to 30.5.2
Bumps [jest-circus](https://github.com/jestjs/jest/tree/HEAD/packages/jest-circus) from 30.5.1 to 30.5.2.
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.5.2/packages/jest-circus)

---
updated-dependencies:
- dependency-name: jest-circus
  dependency-version: 30.5.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-21 16:52:57 +00:00
Vilius Sutkus '89 035682743a [CI] Add 15859902 to test matrix
(This was supposed to be added during previous commits)
2026-09-17 14:30:37 -05:00
Vilius Sutkus '89 be39fa8340 Update README.md with version 15859902 (22.0) 2026-09-17 13:37:30 -05:00
Vilius Sutkus '89 1f87d5b2a1 Add version 15859902 (22.0), default it and update macOS url for it. 2026-09-17 13:35:46 -05:00
Vilius Sutkus '89 138b5fb1cf Update dependencies in README.md 2026-09-17 12:45:50 -05:00
Christoph Grüninger 5ed526629f README.md Update other GitHub Actions in code samples
Old versions are using deprecated Node.js version
2026-09-17 12:43:05 -05:00
Vilius Sutkus '89 ca5c9e054e Upgrade Typescript to v6. Update other deps. 2026-09-17 12:32:13 -05:00
Vilius Sutkus '89 927cbf9b1d Update npm dependencies 2026-09-17 12:00:53 -05:00
dependabot[bot] 76ffd60ae0 Bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-17 11:55:58 -05:00
VolodymyrandClaude Opus 5 7731365548 Fix #537: stop installing the deprecated tools package
Google no longer serves the `tools` package: it is gone from
repository2-3.xml, so `sdkmanager tools` fails with
"Failed to find package 'tools'" and takes the whole action down with it.

- Drop `tools` from the default value of the `packages` input, leaving
  `platform-tools`. The command line tools that replaced it are already
  installed by this action, and there is no bare `cmdline-tools` package
  path to install instead (only versioned ones, e.g. `cmdline-tools;20.0`).
- Skip `tools` with a warning when it is requested explicitly, so the
  many workflows that pass `packages: 'tools platform-tools'` keep working
  instead of failing.
- Update the README accordingly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 11:39:35 -05:00
Vilius Sutkus '89 4d90f94363 [2/2] Update setup-android version in README.md 2026-04-04 23:39:58 +03:00
Vilius Sutkus '89 40fd30fb8d Update setup-android version in README.md 2026-04-04 23:36:52 +03:00
Vilius Sutkus '89 d4e21bf61b Update dependencies and rebuild 2026-04-04 23:30:57 +03:00
dependabot[bot] b7f140eff5 Bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-31 16:36:57 +03:00
Vilius Sutkus '89 651bceb6f9 Migrate from ncc to esbuild
Allows updating @actions/core and @actions/tool-cache. Their old versions had dependencies with security issues.
2026-03-25 00:53:25 +02:00
Vilius Sutkus '89 144235e058 Update actions steps. checkout to v5, node to v6, java to v5, codeql to v4 2026-03-25 00:18:40 +02:00
Vilius Sutkus '89 200c644fca Add cmdline-tools version 20.0 ( 14742923 ) 2026-03-25 00:12:40 +02:00
Vilius Sutkus '89 715acc5ce1 Remove @actions/cache dependency 2026-03-25 00:06:56 +02:00
Vilius Sutkus '89 125835f877 Update (not all) deps, migrate eslint to new format. compile to es2024 2026-03-24 23:22:17 +02:00
Piotr Idzik c4c8fe5bcd Encourage users to use latest version of actions/setup-java
Related to android-actions/setup-android#429
2026-03-24 21:38:16 +02:00
Róbert Papp (TWiStErRob) 6a40db5374 Migrate from Node 20 to Node 24 2026-03-24 21:37:19 +02:00
Róbert Papp (TWiStErRob) 641d7f5e80 Maintain GHA runners 2026-03-24 21:28:16 +02:00
Vilius Sutkus '89 9fc6c4e906 Update dependencies 2024-11-10 00:15:53 +02:00
Vilius Sutkus '89 edebe8927a Update cmdline-tools version in README.md 2024-11-09 23:40:34 +02:00
Stefan Wärting 2022e05939 Add support for versions 12, 13, and 16 2024-11-09 23:37:36 +02:00
Vilius Sutkus '89 f34c17e4f4 [CI] Disable macos-11, enable macos-14 2024-08-09 23:20:30 +03:00
Vilius Sutkus '89 29d7cbabdd [CI] Add workflow_dispatch to run workflow. Remove .github/*.json trigger.
.github/*.json trigger does not seem to trigger anything
2024-08-09 23:20:17 +03:00
Vilius Sutkus '89 bb5134ce76 [CI] Run tests on push in any branch, not just main/release 2024-08-09 23:18:12 +03:00
dependabot[bot] 4b7c168f7a Bump github/codeql-action from 2 to 3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-07 03:34:09 +03:00
Vilius Sutkus '89 39fe32d9f9 npm update typescript 2024-08-07 03:27:32 +03:00
Vilius Sutkus '89 9b404b77f3 npm update eslint 2024-08-07 03:25:17 +03:00
Vilius Sutkus '89 b15b7e58c1 npm update 2024-08-07 03:23:32 +03:00
Vilius Sutkus '89 12a392d9f4 Update more dependencies 2024-06-18 10:45:48 +03:00
Vilius Sutkus '89 f3fd7c000f Update dependencies 2024-06-18 10:36:57 +03:00
Vilius Sutkus '89 5baef82307 [CI] Add Ubuntu-24.04 to the test matrix 2024-06-18 10:18:53 +03:00
dependabot[bot] 3963848dab Bump eslint-plugin-jest from 28.2.0 to 28.6.0
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 28.2.0 to 28.6.0.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v28.2.0...v28.6.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 10:00:47 +03:00
dependabot[bot] c55407a479 Bump eslint-plugin-github from 4.10.2 to 5.0.1
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.10.2 to 5.0.1.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.10.2...v5.0.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-github
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 09:48:26 +03:00
dependabot[bot] 4aaec39eee Bump braces from 3.0.2 to 3.0.3
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 09:47:23 +03:00
dependabot[bot] e1f5280adf Bump eslint-plugin-jest from 27.9.0 to 28.2.0
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.9.0 to 28.2.0.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v27.9.0...v28.2.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 11:11:16 +03:00
dependabot[bot] 961a5d9791 Bump typescript from 5.4.4 to 5.4.5
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.4 to 5.4.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.4.4...v5.4.5)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 11:10:06 +03:00
Vilius Sutkus '89 00854ea68c Update dependencies and rebuild 2024-04-05 13:59:39 +03:00
dependabot[bot] 0d0e8c3af6 Bump typescript from 5.3.2 to 5.4.4
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.3.2 to 5.4.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.3.2...v5.4.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-05 13:50:43 +03:00
dependabot[bot] a9d7b728b4 Bump eslint-plugin-github from 4.10.1 to 4.10.2
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.10.1 to 4.10.2.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.10.1...v4.10.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-github
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-05 13:44:38 +03:00
dependabot[bot] 93337aeebc Bump actions/setup-java from 3 to 4
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-05 13:43:55 +03:00
dependabot[bot] c39b220a9b Bump ts-jest from 29.1.1 to 29.1.2
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 29.1.1 to 29.1.2.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.1.1...v29.1.2)

---
updated-dependencies:
- dependency-name: ts-jest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-22 13:07:30 +02:00
dependabot[bot] 76b557c697 Bump @actions/cache from 3.2.2 to 3.2.4
Bumps [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache) from 3.2.2 to 3.2.4.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

---
updated-dependencies:
- dependency-name: "@actions/cache"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-22 11:45:06 +02:00
dependabot[bot] b7334e0985 Bump prettier from 3.1.0 to 3.2.5
Bumps [prettier](https://github.com/prettier/prettier) from 3.1.0 to 3.2.5.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.1.0...3.2.5)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-22 11:44:08 +02:00
dependabot[bot] 8252dc7232 Bump eslint-plugin-jest from 27.6.0 to 27.9.0
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.6.0 to 27.9.0.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v27.6.0...v27.9.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-22 11:42:51 +02:00
Vilius Sutkus '89 07976c6290 [CI] Don't log licenses 2023-11-25 18:10:19 +02:00
Vilius Sutkus '89 56927e38e2 Update npm dependencies 2023-11-25 18:04:24 +02:00
Vilius Sutkus '89 eb7920b260 Implement action input parameter 'packages' 2023-11-25 17:41:26 +02:00
Vilius Sutkus '89 a86cdbf03d [CI] Call this action by calling action.yml
action.yml has default input arguments. Would rather not duplicate them in CI workflow
2023-11-25 17:25:16 +02:00
Vilius Sutkus '89 713cbf481b [README.md] Update wording about licenses 2023-11-25 17:22:28 +02:00
Vilius Sutkus '89 1297b09c09 [CI] List installed packages 2023-11-25 17:21:46 +02:00
13 changed files with 29449 additions and 38380 deletions

No files matched your search

-3
View File
@@ -1,3 +0,0 @@
dist/
lib/
node_modules/
-55
View File
@@ -1,55 +0,0 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error",
"i18n-text/no-en": "off",
"@typescript-eslint/unbound-method": "error"
},
"env": {
"node": true,
"es6": true,
"jest/globals": true
}
}
+41 -33
View File
@@ -1,13 +1,7 @@
name: Build & Test
on:
pull_request:
paths-ignore:
- '**.md'
push:
branches:
- main
- releases/*
paths-ignore:
- '**.md'
@@ -15,12 +9,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Setup node 20
uses: actions/setup-node@v4
- name: Setup node 24
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
- run: npm ci
@@ -32,12 +26,12 @@ jobs:
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Setup node 20
uses: actions/setup-node@v4
- name: Setup node 24
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
- run: npm ci
@@ -46,12 +40,12 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Setup node 20
uses: actions/setup-node@v4
- name: Setup node 24
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
- run: npm ci
@@ -63,23 +57,35 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, windows-2019, windows-2022 ]
os:
- ubuntu-24.04
- ubuntu-22.04
- macos-26
- macos-15
- macos-14
- windows-2025
- windows-2022
cmdline-tools-version:
- 15859902
- 14742923
- 12266719
- 11479570
- 11076708
- 10406996
- 9862592
- 9477386
- 9123335
- 8512546
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Setup node 20
uses: actions/setup-node@v4
- name: Setup node 24
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v5
with:
java-version: 17
distribution: 'temurin'
@@ -87,23 +93,25 @@ jobs:
- run: npm ci
- run: npm run build
- run: node dist/index.js
env:
INPUT_CMDLINE-TOOLS-VERSION: ${{ matrix.cmdline-tools-version }}
INPUT_ACCEPT-ANDROID-SDK-LICENSES: 'true'
INPUT_LOG-ACCEPTED-ANDROID-SDK-LICENSES: 'false'
- name: Run setup-android
uses: ./
with:
cmdline-tools-version: ${{ matrix.cmdline-tools-version }}
log-accepted-android-sdk-licenses: 'false'
- run: sdkmanager --list_installed
- run: sdkmanager --list
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Setup node 20
uses: actions/setup-node@v4
- name: Setup node 24
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
- run: npm ci
+3 -3
View File
@@ -31,13 +31,13 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v7
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v4
with:
languages: 'javascript'
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v4
+4 -11
View File
@@ -1,17 +1,10 @@
name: Run Android build
on:
pull_request:
paths:
- 'dist/**.js'
- '.github/*.json'
workflow_dispatch:
push:
branches:
- main
- releases/*
paths:
- 'dist/**.js'
- '.github/*.json'
jobs:
build:
@@ -27,16 +20,16 @@ jobs:
if: ${{ false }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
repository: daveol/SampleApplication
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
path: ./build/
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v5
with:
java-version: 17
distribution: 'temurin'
+56 -18
View File
@@ -3,10 +3,10 @@
![Build & Test](https://github.com/android-actions/setup-android/workflows/Build%20&%20Test/badge.svg)
This action sets up the Android SDK tools by:
- Downloading the SDK commandline tools, if the current version (11.0) is not found in either `$ANDROID_SDK_ROOT` or `$HOME/.android/sdk`.
- Downloading the SDK commandline tools, if the current version (16.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/11.0/bin` (contains sdkmanager) to `$PATH`.
- Installing `platform-tools`.
- Adding `platform-tools` (contains adb) and `cmdline-tools/16.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.
@@ -23,60 +23,98 @@ See [action.yml](action.yml)
## Basic
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v6
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
uses: android-actions/setup-android@v4
- name: Build SampleApplication
run: ./gradlew --no-daemon build
```
## Additional packages
By default, sdkmanager installs "tools" and "platform-tools" packages. To install additional packages, call sdkmanager manually:
Input parameter `packages` controls which packages this action will install from Android SDK.
Default value is `platform-tools`, supply an empty string to skip installing additional packages.
Additional packages can be installed at a later time by calling sdkmanager manually.
```yaml
- name: Setup Android SDK
uses: android-actions/setup-android@v3
uses: android-actions/setup-android@v4
with:
packages: ''
- run: sdkmanager "ndk;26.1.10909125" "cmake;3.22.1"
# ...
- run: sdkmanager platform-tools
```
## The deprecated `tools` package
Google no longer serves the `tools` package, see [tools#tools-sdk](https://developer.android.com/tools#tools-sdk).
Asking for it fails with `Failed to find package 'tools'`, so it is no longer part of the default value of `packages`.
If it is requested explicitly, this action skips it with a warning rather than failing the build.
Most of what `tools` provided now lives in the command line tools, which this action installs and adds to `$PATH`
regardless of the `packages` input, so these need no install step at all:
`apkanalyzer` `avdmanager` `lint` `screenshot2` `sdkmanager` `retrace` `resourceshrinker` `profgen` `d8` `r8`
The emulator was split out of `tools` into its own package, request it explicitly if you need it:
```yaml
- name: Setup Android SDK
uses: android-actions/setup-android@v4
with:
packages: 'platform-tools emulator'
```
The remaining `tools` contents have no replacement in the current SDK: `android` was superseded by `sdkmanager` and
`avdmanager`, ProGuard by [R8](https://developer.android.com/build/shrink-code), and `monitor`, `ddms`, `monkeyrunner`
and `uiautomatorviewer` were dropped without one.
## 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).
By default, setup-android installs version 15859902 (short version 22.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
uses: android-actions/setup-android@v4
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 |
|---------------| --- |
| 22.0 | 15859902 |
| 20.0 | 14742923 |
| 16.0 | 12266719 |
| 13.0 | 11479570 |
| 12.0 | 11076708 |
| 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
# Android SDK Licenses
Android SDK (unsurprisingly) is not public domain software, it comes with a license.
Android SDK is not public domain software, it comes with a license.
Input parameter `accept-android-sdk-licenses` decides if Android SDK licenses should be agreed to on behalf of the user of this action.
Default option is 'yes', because otherwise SDK is unusable until said licenses are agreed to.
+7 -2
View File
@@ -6,7 +6,7 @@ inputs:
cmdline-tools-version:
description: 'cmdline-tools-version. See https://developer.android.com/studio#command-line-tools-only'
required: false
default: '10406996'
default: '15859902'
accept-android-sdk-licenses:
description: 'Android SDK is usable only after the license agreement. Should setup-android agree to the licences, provided by "sdkmanager --licenses"'
@@ -18,8 +18,13 @@ inputs:
required: false
default: 'true'
packages:
description: 'Additional packages to install'
required: false
default: 'platform-tools'
runs:
using: node20
using: node24
main: 'dist/index.js'
branding:
+23083 -29983
View File
File diff suppressed because it is too large. Load diff
+70
View File
@@ -0,0 +1,70 @@
const jestPlugin = require('eslint-plugin-jest');
const tsParser = require('@typescript-eslint/parser');
const tsPlugin = require('@typescript-eslint/eslint-plugin');
const checkFile = require('eslint-plugin-check-file');
const globals = require('globals');
module.exports = [
{
ignores: ['dist/', 'lib/', 'node_modules/']
},
{
files: ['**/*.ts', '**/*.tsx'],
plugins: {
jest: jestPlugin,
'@typescript-eslint': tsPlugin,
'check-file': checkFile,
},
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json',
},
globals: {
...globals.node,
...globals.es6,
...globals.jest,
},
},
rules: {
'check-file/filename-naming-convention': ['error', {
'**/*.ts': 'KEBAB_CASE',
}],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/explicit-member-accessibility': ['error', {accessibility: 'no-public'}],
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/ban-ts-comment': 'error',
camelcase: 'off',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/explicit-function-return-type': ['error', {allowExpressions: true}],
'func-call-spacing': ['error', 'never'],
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/prefer-function-type': 'warn',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
semi: ['error', 'never'],
'@typescript-eslint/unbound-method': 'error',
},
},
];
+6101 -8239
View File
File diff suppressed because it is too large. Load diff
+18 -18
View File
@@ -5,7 +5,7 @@
"description": "setup android action",
"main": "lib/main.js",
"scripts": {
"build": "ncc build src/main.ts --out dist/",
"build": "tsc && esbuild lib/main.js --bundle --platform=node --target=node24 --format=cjs --outfile=dist/index.js",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/*.ts",
@@ -25,24 +25,24 @@
"author": "daveol",
"license": "ISC",
"dependencies": {
"@actions/cache": "^3.2.2",
"@actions/core": "^1.10.1",
"@actions/tool-cache": "^2.0.1"
"@actions/core": "^3.0.1",
"@actions/tool-cache": "^4.0.0"
},
"devDependencies": {
"@types/jest": "^29.5.5",
"@types/node": "^20.6.5",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"@vercel/ncc": "^0.38.0",
"eslint": "^8.50.0",
"eslint-plugin-github": "^4.10.0",
"eslint-plugin-jest": "^27.4.0",
"jest": "^29.7.0",
"jest-circus": "^29.7.0",
"js-yaml": "^4.1.0",
"prettier": "^3.0.3",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
"@types/jest": "^30.0.0",
"@types/node": "^24.13.5",
"@typescript-eslint/eslint-plugin": "^8.70.0",
"@typescript-eslint/parser": "^8.70.0",
"esbuild": "^0.28.2",
"eslint": "^10.10.0",
"eslint-plugin-check-file": "^3.3.2",
"eslint-plugin-jest": "^29.16.6",
"globals": "^17.12.0",
"jest": "^30.5.1",
"jest-circus": "^30.5.2",
"js-yaml": "^5.4.2",
"prettier": "^3.9.7",
"ts-jest": "^29.4.12",
"typescript": "^6.0.3"
}
}
+43 -4
View File
@@ -7,6 +7,16 @@ import * as os from 'os'
function getVersionShort(versionLong: string): string {
switch (versionLong) {
case '15859902':
return '22.0'
case '14742923':
return '20.0'
case '12266719':
return '16.0'
case '11479570':
return '13.0'
case '11076708':
return '12.0'
case '10406996':
return '11.0'
case '9862592':
@@ -33,6 +43,7 @@ const VERSION_SHORT = getVersionShort(VERSION_LONG)
const COMMANDLINE_TOOLS_WIN_URL = `https://dl.google.com/android/repository/commandlinetools-win-${VERSION_LONG}_latest.zip`
const COMMANDLINE_TOOLS_MAC_URL = `https://dl.google.com/android/repository/commandlinetools-mac-${VERSION_LONG}_latest.zip`
const COMMANDLINE_TOOLS_MAC_ARM64_URL = `https://dl.google.com/android/repository/commandlinetools-mac_arm64-${VERSION_LONG}_latest.zip`
const COMMANDLINE_TOOLS_LIN_URL = `https://dl.google.com/android/repository/commandlinetools-linux-${VERSION_LONG}_latest.zip`
const ANDROID_HOME_SDK_DIR = path.join(os.homedir(), '.android', 'sdk')
@@ -97,7 +108,11 @@ async function installSdkManager(): Promise<string> {
if (process.platform === 'linux') {
cmdlineToolsURL = COMMANDLINE_TOOLS_LIN_URL
} else if (process.platform === 'darwin') {
cmdlineToolsURL = COMMANDLINE_TOOLS_MAC_URL
if (Number(VERSION_LONG) >= 15859902) {
cmdlineToolsURL = COMMANDLINE_TOOLS_MAC_ARM64_URL
} else {
cmdlineToolsURL = COMMANDLINE_TOOLS_MAC_URL
}
} else if (process.platform === 'win32') {
cmdlineToolsURL = COMMANDLINE_TOOLS_WIN_URL
} else {
@@ -156,8 +171,33 @@ async function run(): Promise<void> {
core.getBooleanInput('log-accepted-android-sdk-licenses')
)
}
await callSdkManager(sdkManagerExe, 'tools')
await callSdkManager(sdkManagerExe, 'platform-tools')
const packages = core
.getInput('packages', {required: false})
.split(' ')
.map(function (str) {
return str.trim()
})
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
.filter(function (element, index, array) {
return element
})
.filter(function (pkg) {
// The 'tools' package is deprecated and no longer served by Google,
// asking sdkmanager for it fails the whole action.
// Its replacement, cmdline-tools, is already installed by this action.
if (pkg === 'tools') {
core.warning(
"Skipping deprecated package 'tools', it is no longer available in the Android SDK repository. " +
'The command line tools installed by this action replace it, see https://developer.android.com/tools#tools-sdk'
)
return false
}
return true
})
for (const pkg of packages) {
await callSdkManager(sdkManagerExe, pkg)
}
core.setOutput('ANDROID_COMMANDLINE_TOOLS_VERSION', VERSION_LONG)
core.exportVariable('ANDROID_HOME', ANDROID_SDK_ROOT)
@@ -167,7 +207,6 @@ async function run(): Promise<void> {
core.addPath(path.join(ANDROID_SDK_ROOT, 'platform-tools'))
core.debug('add matchers')
// eslint-disable-next-line no-console
console.log(`##[add-matcher]${path.join(__dirname, '..', 'matchers.json')}`)
}
+23 -11
View File
@@ -1,13 +1,25 @@
{
"compilerOptions": {
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"outDir": "./lib", /* Redirect output structure to the directory. */
"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. */
"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'. */
"moduleResolution": "node"
},
"exclude": ["node_modules", "**/*.test.ts"]
"compilerOptions": {
"target": "ES2024",
"module": "es2022",
"moduleResolution": "bundler",
"lib": [
"ES2024"
],
"types": ["node", "jest"],
"outDir": "./lib",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"exclude": [
"node_modules",
"**/*.test.ts",
"lib"
]
}