121 Commits

Author SHA1 Message Date
dependabot[bot]
8b1cdcb7c2 Bump eslint-plugin-github from 5.0.2 to 5.1.8
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 5.0.2 to 5.1.8.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v5.0.2...v5.1.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 16:22:22 +00: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
Vilius Sutkus '89
d24156dbc9 [README.md] Add a note about installed packages 2023-11-21 22:41:46 +02:00
Vilius Sutkus '89
ade8112388 Change "Licence" to "License" 2023-11-21 22:35:25 +02:00
Vilius Sutkus '89
aeaba18a12 [Issue #384] Implement silent licence agreement. 2023-11-21 22:11:35 +02:00
Vilius Sutkus '89
423241b186 Don't eslint warn about English text in string literals 2023-11-21 21:35:16 +02:00
Vilius Sutkus '89
4113fd9036 [CI] Test all cmdlinetools versions 2023-11-21 21:32:42 +02:00
Vilius Sutkus '89
0549df86ae Update npm dependencies 2023-11-21 21:27:27 +02:00
Vilius Sutkus '89
b6023dae3a [CI] Update actions/setup-node to v4 2023-11-21 21:25:54 +02:00
Vilius Sutkus '89
ded9227d6b [CI] Update actions/checkout to v4 2023-11-21 21:25:09 +02:00
Vilius Sutkus '89
449627e76b Format file to match correct "desired" width. Remove leftover debug printout 2023-11-21 21:22:57 +02:00
Vilius Sutkus '89
8023252681 [Issue #192] Accept cmdline-tools-version input parameter 2023-11-21 21:18:33 +02:00
Vilius Sutkus '89
9584f05408 [README.md] Update version of this action 2023-09-25 04:30:57 +03:00
dependabot[bot]
13f81365a4 Bump github/codeql-action from 1 to 2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [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/v1...v2)

---
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>
2023-09-25 03:55:25 +03:00
Vilius Sutkus '89
110787489d [README.md] Update JDK version in step name 2023-09-25 03:53:50 +03:00
Vilius Sutkus '89
4ba30747dc [CI] Use Temurin JDK. Adopt JDK is discontinued
( according to https://github.com/actions/setup-java#supported-distributions )
2023-09-25 03:53:00 +03:00
Omar Shehata
a3da945276 Fix README example 2023-09-25 03:48:44 +03:00
Vilius Sutkus '89
1cb03f027b Update node dependencies & Rebuild 2023-09-25 03:37:15 +03:00
Vilius Sutkus '89
ccc0939481 Use Node-20 instead of end-of-life Node-16
Would prefer to use Node-18, because it's LTS, but I can't, because it's not available:
https://github.com/actions/runner-images/discussions/7664
2023-09-25 03:20:06 +03:00
Vilius Sutkus '89
fabcc053ca [CI] Add macos-13 to test matrix 2023-09-25 03:14:01 +03:00
Vilius Sutkus '89
bee5ac3f90 Update cmdline-tools to 11.0 (latest) 2023-09-25 03:04:50 +03:00
Vilius Sutkus '89
26c86ac3f5 Update JDK to 17 (from 1.8). Required for current cmdline-tools 2023-09-25 03:03:19 +03:00
Vilius Sutkus '89
bc52f43eb3 [CI] Remove ubuntu-18.04 from test matrix 2023-09-25 03:02:55 +03:00
Simon Marquis
899d70efad Update commandlinetools version to 9.0 (latest)
https://developer.android.com/studio#command-line-tools-only
2023-09-25 02:57:03 +03:00
Vilius Sutkus '89
7c5672355a Rebuild 2022-10-18 22:49:38 +03:00
Vilius Sutkus '89
be14762587 Update dependencies 2022-10-18 22:48:21 +03:00
dependabot[bot]
02a4c0fae6 Bump @actions/cache from 3.0.0 to 3.0.5
Bumps [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache) from 3.0.0 to 3.0.5.
- [Release notes](https://github.com/actions/toolkit/releases)
- [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>
2022-10-18 22:35:00 +03:00
dependabot[bot]
4963c9b31a Bump @actions/core from 1.9.0 to 1.10.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-18 22:32:16 +03:00
Vilius Sutkus '89
2741e25473 Update README.md 2022-08-03 16:44:44 +03:00
Vilius Sutkus '89
ed89994087 Merge branch 'main' of github.com:android-actions/setup-android 2022-08-03 16:38:34 +03:00
Vilius Sutkus '89
240c9729bd Downgrade @types/node to 16, because we are using node LTS - 16. 2022-08-03 16:14:58 +03:00
Vilius Sutkus '89
36d0d24ca4 Update dependencies 2022-08-03 16:09:19 +03:00
Vilius Sutkus '89
cabf29c9ef [CI] Update "rebuild needed" check 2022-08-03 15:56:56 +03:00
Vilius Sutkus '89
65b8c7bc99 [CI] Add a "rebuild needed" check 2022-08-03 15:27:53 +03:00
Vilius Sutkus '89
34f33aad26 Use Node16 (current LTS), instead of Node12 2022-08-03 15:23:56 +03:00
Vilius Sutkus '89
3d201fcd51 Update cmdline-tools version to 7.0 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
1ba064a8a2 [2/2] Read version of cmdline-tools/latest, if version is correct - use it 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
4360e92aa0 Read version of cmdline-tools/latest, if version is correct - use it 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
88c04cbb34 [CI] Remove macos-10.15, because it is deprecated 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
239c6f5c7c [CI] Update test matrix to include ubuntu-22.04 and macos-12 2022-08-03 15:19:19 +03:00
Vilius Sutkus '89
882b1d3cd5 Update cmdline-tools version to 7.0 2022-08-03 15:03:16 +03:00
Vilius Sutkus '89
00dbb341f0 [2/2] Read version of cmdline-tools/latest, if version is correct - use it 2022-08-03 15:02:48 +03:00
Vilius Sutkus '89
c1ac9c4be4 Read version of cmdline-tools/latest, if version is correct - use it 2022-08-03 15:00:44 +03:00
Vilius Sutkus '89
0f0da39d59 [CI] Remove macos-10.15, because it is deprecated 2022-08-03 13:39:25 +03:00
Vilius Sutkus '89
c6c2260dde [CI] Update test matrix to include ubuntu-22.04 and macos-12 2022-08-03 13:36:32 +03:00
Vilius Sutkus '89
47ea489789 [CI] Disable run.yml 2022-04-22 06:28:18 +03:00
Vilius Sutkus '89
244317f5bb Rebuild dist/index.js after dependency update 2022-04-22 06:25:41 +03:00
Vilius Sutkus '89
5440ded976 [ESLint] warn instead of error about English text in string literals 2022-04-22 06:24:03 +03:00
Vilius Sutkus '89
e94bbf69b5 Update npm dependencies 2022-04-22 06:18:23 +03:00
Vilius Sutkus '89
98f14d164f [CI][README.md] Update setup-java to v3 2022-04-22 05:44:03 +03:00
Vilius Sutkus '89
f56c207000 [CI] Update actions/setup-node to v3 (sliding version, instead of 2.2.2) 2022-04-22 05:41:02 +03:00
Vilius Sutkus '89
a7d36b05d1 [CI][README.MD] Update actions/checkout to v3 2022-04-22 05:38:58 +03:00
Vilius Sutkus '89
20bad8a341 [CI][Test] Update OS list 2022-04-22 05:34:57 +03:00
Mike Hardy
fc91ea75c1 build(deps): bump tools version to v6 / 8092744 2022-04-22 05:22:01 +03:00
Dave Olsthoorn
1685c3d866 workflow: code analysis 2021-07-17 19:13:18 +02:00
Dave Olsthoorn
62d9713f6c workflow: add distribution to setup-java 2021-07-17 19:10:26 +02:00
Dave Olsthoorn
e2a3af499e package.json: bump to version 2021-07-17 19:06:08 +02:00
Dave Olsthoorn
c83cf2fad5 tsconfig: set moduleResolution 2021-07-17 18:55:57 +02:00
dependabot[bot]
39db4a222a Bump @vercel/ncc from 0.27.0 to 0.29.0
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.27.0 to 0.29.0.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.27.0...0.29.0)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-17 18:51:07 +02:00
dependabot[bot]
69e42af51e Bump fs-extra from 9.1.0 to 10.0.0
Bumps [fs-extra](https://github.com/jprichardson/node-fs-extra) from 9.1.0 to 10.0.0.
- [Release notes](https://github.com/jprichardson/node-fs-extra/releases)
- [Changelog](https://github.com/jprichardson/node-fs-extra/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jprichardson/node-fs-extra/compare/9.1.0...10.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-17 18:47:51 +02:00
dependabot[bot]
1eccbc5efd Bump jest-circus from 26.6.3 to 27.0.6
Bumps [jest-circus](https://github.com/facebook/jest/tree/HEAD/packages/jest-circus) from 26.6.3 to 27.0.6.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v27.0.6/packages/jest-circus)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-17 18:14:52 +02:00
dependabot[bot]
54a403b145 Bump @types/node from 14.17.5 to 16.3.3
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.17.5 to 16.3.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-17 18:14:13 +02:00
dependabot[bot]
4bd635e9b7 Bump actions/setup-node from 2.1.5 to 2.2.0
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2.1.5 to 2.2.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2.1.5...v2.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-17 18:06:56 +02:00
Dave Olsthoorn
7528b5330e build: update build 2021-07-17 18:06:29 +02:00
Dave Olsthoorn
c1a2a96971 package-lock: run npm update 2021-07-17 18:04:48 +02:00
Dave Olsthoorn
a812d70a1a build: update build with new dependencies 2021-05-25 11:56:10 +02:00
Dave Olsthoorn
9bd8ed6b1f dependencies: update them all 2021-05-25 11:54:58 +02:00
dependabot[bot]
ecf659ded2 Bump @actions/core from 1.2.6 to 1.3.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.6 to 1.3.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-25 11:44:24 +02:00
dependabot[bot]
8f636b1085 Bump eslint-plugin-github from 4.1.1 to 4.1.3
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.1.1 to 4.1.3.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.1.1...v4.1.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 18:56:31 +02:00
dependabot[bot]
be688ab050 Bump ts-jest from 26.5.2 to 26.5.5
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 26.5.2 to 26.5.5.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v26.5.2...v26.5.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 18:56:17 +02:00
dependabot[bot]
2842aed41c Bump @types/node from 14.14.31 to 14.14.41
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.31 to 14.14.41.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 18:51:45 +02:00
dependabot[bot]
bc065618ae Bump typescript from 4.2.2 to 4.2.4
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.2 to 4.2.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.2.2...v4.2.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 18:51:08 +02:00
dependabot[bot]
2d34867f5a Bump eslint-plugin-jest from 24.1.5 to 24.3.6
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 24.1.5 to 24.3.6.
- [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/v24.1.5...v24.3.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 18:50:43 +02:00
dependabot[bot]
2469709471 Bump actions/setup-java from v1 to v2
Bumps [actions/setup-java](https://github.com/actions/setup-java) from v1 to v2.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v1...8764a52df183aa0ccea74521dfd9d506ffc7a19a)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 18:48:58 +02:00
Vilius Sutkus '89
3404b45d4c Don't minify dist/index.js, ~150kb of added bloat.
Will be easier to debug production errors later.
2021-03-03 01:07:35 +02:00
Vilius Sutkus '89
161f0b2707 Rebuild dist/index.js with updated deps 2021-03-03 01:00:48 +02:00
Vilius Sutkus '89
ae8a1c8d80 Upgrade zeit/ncc to vercel/ncc. zeit/ncc is deprecated 2021-03-03 00:55:11 +02:00
Vilius Sutkus '89
e458de9c46 Update package-lock file version to 2 (npm-7)
Line reorder in package.json
2021-03-03 00:48:48 +02:00
Vilius Sutkus '89
da1ab05e31 Comments about mkdir/rmdir 2021-03-03 00:43:22 +02:00
dependabot[bot]
910b2809b6 Bump @typescript-eslint/eslint-plugin from 4.15.2 to 4.16.1 (#116)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.15.2 to 4.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.16.1/packages/eslint-plugin)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:40:40 +02:00
dependabot[bot]
7fc55be752 Bump @typescript-eslint/parser from 4.15.1 to 4.16.1 (#118)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.15.1 to 4.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.16.1/packages/parser)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:35:22 +02:00
dependabot[bot]
36160f0297 Bump @types/fs-extra from 9.0.7 to 9.0.8 (#117)
Bumps [@types/fs-extra](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/fs-extra) from 9.0.7 to 9.0.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/fs-extra)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:24:04 +02:00
dependabot[bot]
46ed96d180 Bump ts-jest from 26.5.1 to 26.5.2 (#111)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 26.5.1 to 26.5.2.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v26.5.1...v26.5.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:19:30 +02:00
dependabot[bot]
57a1f875c4 Bump js-yaml from 3.14.1 to 4.0.0 (#87)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.1 to 4.0.0.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...4.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:19:04 +02:00
dependabot[bot]
cee829806b Bump actions/setup-node from v2.1.4 to v2.1.5 (#109)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from v2.1.4 to v2.1.5.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2.1.4...46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:11:43 +02:00
dependabot[bot]
a83cba80ae Bump @typescript-eslint/eslint-plugin from 4.15.1 to 4.15.2 (#110)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.15.1 to 4.15.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.15.2/packages/eslint-plugin)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:10:39 +02:00
dependabot[bot]
53fbf5011f Bump typescript from 4.1.5 to 4.2.2 (#112)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.5 to 4.2.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.5...v4.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:10:01 +02:00
dependabot[bot]
ef1614e11f Bump eslint from 7.20.0 to 7.21.0 (#113)
Bumps [eslint](https://github.com/eslint/eslint) from 7.20.0 to 7.21.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.20.0...v7.21.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 00:09:25 +02:00
Laura
7506bcd002 [Issue #108] Overwrite CLI Tools (#115)
* Trying this

* Revert "Trying this"

This reverts commit 46eab8f218.

* Put exists check around tools move

* Remove directory before copying over it

* Reverted indent

* Revert additional two spaces
2021-03-03 00:02:20 +02:00
Vilius Sutkus '89
0bdb2caf82 [issue #108] Remove zip extraction leftovers 2021-03-02 03:05:42 +02:00
12 changed files with 42390 additions and 7619 deletions

View File

@@ -44,6 +44,7 @@
"semi": "off",
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error",
"i18n-text/no-en": "off",
"@typescript-eslint/unbound-method": "error"
},
"env": {

View File

@@ -1,13 +1,7 @@
name: Build & Test
on:
pull_request:
paths-ignore:
- '**.md'
push:
branches:
- main
- releases/*
paths-ignore:
- '**.md'
@@ -15,26 +9,29 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup node 12
uses: actions/setup-node@v2.1.4
- name: Setup node 20
uses: actions/setup-node@v4
with:
node-version: '12'
node-version: 20
- 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@v2
- uses: actions/checkout@v4
- name: Setup node 12
uses: actions/setup-node@v2.1.4
- name: Setup node 20
uses: actions/setup-node@v4
with:
node-version: '12'
node-version: 20
- run: npm ci
@@ -43,12 +40,12 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup node 12
uses: actions/setup-node@v2.1.4
- name: Setup node 20
uses: actions/setup-node@v4
with:
node-version: '12'
node-version: 20
- run: npm ci
@@ -56,35 +53,64 @@ jobs:
runSdkManager:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} - ${{ matrix.cmdline-tools-version }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2016, windows-2019 ]
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
- macos-14
- macos-13
- macos-12
- windows-2022
- windows-2019
cmdline-tools-version:
- 12266719
- 11479570
- 11076708
- 10406996
- 9862592
- 9477386
- 9123335
- 8512546
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup node 12
uses: actions/setup-node@v2.1.4
- name: Setup node 20
uses: actions/setup-node@v4
with:
node-version: '12'
node-version: 20
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- run: npm ci
- run: npm run build
- run: node dist/index.js
- 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@v2
- uses: actions/checkout@v4
- name: Setup node 12
uses: actions/setup-node@v2.1.4
- name: Setup node 20
uses: actions/setup-node@v4
with:
node-version: '12'
node-version: 20
- run: npm ci

43
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -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@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'javascript'
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

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:
@@ -22,19 +15,24 @@ jobs:
- ubuntu-latest
- windows-latest
- macos-latest
# Disabled, because daveol/SampleApplication is missing
if: ${{ false }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: daveol/SampleApplication
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
path: ./build/
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 1.8
java-version: 17
distribution: 'temurin'
- name: Setup Android SDK
id: 'setup-android'

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -3,9 +3,18 @@
![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
- Accepting the SDK licenses
- 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/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.
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
@@ -14,20 +23,78 @@ See [action.yml](action.yml)
## Basic
```yaml
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v2
uses: android-actions/setup-android@v3
- name: Build SampleApplication
run: ./gradlew --no-daemon build
```
## Additional packages
Input parameter `packages` controls which packages this action will install from Android SDK.
Default value is `tools 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
with:
packages: ''
# ...
- run: sdkmanager tools platform-tools
```
## 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 12266719 (short version 16.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 |
|---------------| --- |
| 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 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.
licenses are quite long, to prevent a wall of text in the action output, licenses can be agreed to silently.
Input parameter `log-accepted-android-sdk-licenses` controls whether license texts should be printed or omitted from the text output. Defaults to 'true'.
# Thanks
Based on the project [android-problem-matchers-action](https://github.com/jonasb/android-problem-matchers-action) from [@jonasb](https://github.com/jonasb)

View File

@@ -2,8 +2,29 @@ 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: '12266719'
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"'
required: false
default: 'true'
log-accepted-android-sdk-licenses:
description: 'Should accepted licenses be logged. If not, accepted licences will be accepted silently'
required: false
default: 'true'
packages:
description: 'Additional packages to install'
required: false
default: 'tools platform-tools'
runs:
using: 'node12'
using: node20
main: 'dist/index.js'
branding:

30361
dist/index.js vendored

File diff suppressed because one or more lines are too long

19108
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
"description": "setup android action",
"main": "lib/main.js",
"scripts": {
"build": "ncc build src/main.ts --out dist/ --minify",
"build": "ncc build src/main.ts --out dist/",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/*.ts",
@@ -25,26 +25,24 @@
"author": "daveol",
"license": "ISC",
"dependencies": {
"@actions/cache": "^1.0.6",
"@actions/core": "^1.2.6",
"@actions/tool-cache": "^1.6.1",
"fs-extra": "^9.1.0"
"@actions/cache": "^3.2.4",
"@actions/core": "^1.10.1",
"@actions/tool-cache": "^2.0.1"
},
"devDependencies": {
"@types/jest": "^26.0.20",
"@types/node": "^14.14.31",
"@typescript-eslint/eslint-plugin": "^4.15.1",
"@typescript-eslint/parser": "^4.15.1",
"@types/fs-extra": "^9.0.6",
"@zeit/ncc": "^0.22.3",
"eslint": "^7.20.0",
"eslint-plugin-github": "^4.1.1",
"eslint-plugin-jest": "^24.1.5",
"jest": "^26.6.3",
"jest-circus": "^26.6.3",
"js-yaml": "^3.14.1",
"prettier": "^2.2.1",
"ts-jest": "^26.5.1",
"typescript": "^4.1.5"
"@types/jest": "^29.5.5",
"@types/node": "^20.6.5",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vercel/ncc": "^0.38.0",
"eslint": "^8.57.0",
"eslint-plugin-github": "^5.1.8",
"eslint-plugin-jest": "^28.6.0",
"jest": "^29.7.0",
"jest-circus": "^29.7.0",
"js-yaml": "^4.1.0",
"prettier": "^3.3.2",
"ts-jest": "^29.1.5",
"typescript": "^5.5.4"
}
}

View File

@@ -3,98 +3,102 @@ import * as tc from '@actions/tool-cache'
import * as exec from '@actions/exec'
import * as path from 'path'
import * as fs from 'fs'
import * as fse from 'fs-extra'
import * as os from 'os'
const CMDLINE_TOOLS_VERSION = '3.0'
const COMMANDLINE_TOOLS_VERSION = '6858069'
function getVersionShort(versionLong: string): string {
switch (versionLong) {
case '12266719':
return '16.0'
case '11479570':
return '13.0'
case '11076708':
return '12.0'
case '10406996':
return '11.0'
case '9862592':
return '10.0'
case '9477386':
return '9.0'
case '9123335':
return '8.0'
case '8512546':
return '7.0'
default:
return versionLong
}
}
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_LIN_URL = `https://dl.google.com/android/repository/commandlinetools-linux-${COMMANDLINE_TOOLS_VERSION}_latest.zip`
const VERSION_LONG = core.getInput('cmdline-tools-version', {
trimWhitespace: true
})
if (VERSION_LONG.includes('/') || VERSION_LONG.includes('\\')) {
core.setFailed('Malformed cmdline-tools-version!')
throw new Error('Malformed cmdline-tools-version!')
}
const VERSION_SHORT = getVersionShort(VERSION_LONG)
const HOME = os.homedir()
const ANDROID_HOME_DIR = path.join(HOME, '.android')
const ANDROID_HOME_SDK_DIR = path.join(ANDROID_HOME_DIR, 'sdk')
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_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')
let ANDROID_SDK_ROOT = process.env['ANDROID_SDK_ROOT'] || ANDROID_HOME_SDK_DIR
function getSdkManagerPath(cmdToolsVersion: string): string {
return path.join(
ANDROID_SDK_ROOT,
'cmdline-tools',
cmdToolsVersion,
'bin',
'sdkmanager'
)
}
function findPreinstalledSdkManager(): {
isFound: boolean
isCorrectVersion: boolean
exePath: string
} {
const result = {isFound: false, isCorrectVersion: false, exePath: ''}
// First try to find the version defined in CMDLINE_TOOLS_VERSION
result.exePath = getSdkManagerPath(CMDLINE_TOOLS_VERSION)
result.isFound = fs.existsSync(result.exePath)
if (result.isFound) {
result.isCorrectVersion = true
return result
}
// cmdline-tools could have a 'latest' version, but if it was installed 2 years ago
// it may not be 'latest' as of today
result.exePath = getSdkManagerPath('latest')
result.isFound = fs.existsSync(result.exePath)
if (result.isFound) {
return result
}
result.exePath = ''
// Find whatever version is available in ANDROID_SDK_ROOT
const cmdlineToolsDir = path.join(ANDROID_SDK_ROOT, 'cmdline-tools')
const foundVersions: string[] = fs.existsSync(cmdlineToolsDir)
? fs.readdirSync(cmdlineToolsDir)
: []
const foundVersionsFiltered: string[] = foundVersions.filter(
obj => '.' !== obj && '..' !== obj
)
// Sort by desc, to get 2.0 first, before 1.0
const foundVersionsSorted: string[] = foundVersionsFiltered.sort(
(a: string, b: string) => (a > b ? -1 : 1)
)
for (const version of foundVersionsSorted) {
result.exePath = getSdkManagerPath(version)
result.isFound = fs.existsSync(result.exePath)
if (result.isFound) {
return result
}
}
result.exePath = ''
return result
}
async function callSdkManager(sdkManager: string, arg: string): Promise<void> {
async function callSdkManager(
sdkManager: string,
arg: string,
printOutput: Boolean = true
): Promise<void> {
const acceptBuffer = Buffer.from(Array(10).fill('y').join('\n'), 'utf8')
await exec.exec(sdkManager, [arg], {
input: acceptBuffer
input: acceptBuffer,
silent: !printOutput
})
}
async function installSdkManager(): Promise<string> {
fs.mkdirSync(ANDROID_SDK_ROOT, {recursive: true})
// touch $ANDROID_SDK_ROOT/repositories.cfg
fs.closeSync(
fs.openSync(path.join(ANDROID_SDK_ROOT, 'repositories.cfg'), 'w')
const cmdlineTools = path.join(
ANDROID_SDK_ROOT,
'cmdline-tools',
VERSION_SHORT
)
let sdkManagerExe = path.join(cmdlineTools, 'bin', 'sdkmanager')
const sdkManager = findPreinstalledSdkManager()
if (!sdkManager.isFound) {
if (!fs.existsSync(sdkManagerExe)) {
const latestCmdlineTools = path.join(
ANDROID_SDK_ROOT,
'cmdline-tools',
'latest'
)
const sourcePropertiesFile = path.join(
latestCmdlineTools,
'source.properties'
)
const latestSdkManagerExe = path.join(
latestCmdlineTools,
'bin',
'sdkmanager'
)
if (
fs.existsSync(latestCmdlineTools) &&
fs.existsSync(sourcePropertiesFile) &&
fs.existsSync(latestSdkManagerExe)
) {
const sourceProperties = fs.readFileSync(sourcePropertiesFile)
core.info(
`Found preinstalled sdkmanager in ${latestCmdlineTools} with following source.properties:`
)
core.info(sourceProperties.toString())
if (sourceProperties.includes(`Pkg.Revision=${VERSION_SHORT}`)) {
core.info(`Preinstalled sdkmanager has the correct version`)
sdkManagerExe = latestSdkManagerExe
} else {
core.info(`Wrong version in preinstalled sdkmanager`)
}
}
}
if (!fs.existsSync(sdkManagerExe)) {
let cmdlineToolsURL
if (process.platform === 'linux') {
cmdlineToolsURL = COMMANDLINE_TOOLS_LIN_URL
@@ -106,37 +110,27 @@ async function installSdkManager(): Promise<string> {
core.error(`Unsupported platform: ${process.platform}`)
return ''
}
core.info(`Downloading commandline tools from ${cmdlineToolsURL}`)
const cmdlineToolsZip = await tc.downloadTool(cmdlineToolsURL)
const cmdlineToolsExtractedLocation = await tc.extractZip(cmdlineToolsZip)
// Move cmdline-tools to where it would be if it was installed through sdkmanager
// Will allow calling sdkmanager without --sdk_root='..' argument
const desiredLocation = path.join(
ANDROID_SDK_ROOT,
'cmdline-tools',
CMDLINE_TOOLS_VERSION
)
const extractTo = path.join(ANDROID_SDK_ROOT, 'cmdline-tools')
await tc.extractZip(cmdlineToolsZip, extractTo)
fs.mkdirSync(path.dirname(desiredLocation), {recursive: true})
// @TODO: use io.mv instead of fs-extra once following issue is resolved:
// https://github.com/actions/toolkit/issues/706
fse.moveSync(
path.join(cmdlineToolsExtractedLocation, 'cmdline-tools'),
desiredLocation
)
sdkManager.exePath = getSdkManagerPath(CMDLINE_TOOLS_VERSION)
sdkManager.isCorrectVersion = true
// Make sure we don't have leftover target directory (happens sometimes...)
if (fs.existsSync(cmdlineTools)) {
core.info(`Removing leftovers from ${cmdlineTools}`)
fs.rmSync(cmdlineTools, {recursive: true})
}
fs.renameSync(path.join(extractTo, 'cmdline-tools'), cmdlineTools)
}
if (!sdkManager.isCorrectVersion) {
await callSdkManager(
sdkManager.exePath,
`cmdline-tools;${CMDLINE_TOOLS_VERSION}`
)
sdkManager.exePath = getSdkManagerPath(CMDLINE_TOOLS_VERSION)
}
return sdkManager.exePath
// touch $ANDROID_SDK_ROOT/repositories.cfg
fs.closeSync(
fs.openSync(path.join(ANDROID_SDK_ROOT, 'repositories.cfg'), 'w')
)
core.debug(`sdkmanager available at: ${sdkManagerExe}`)
return sdkManagerExe
}
async function run(): Promise<void> {
@@ -158,17 +152,36 @@ async function run(): Promise<void> {
}
}
const sdkManager = await installSdkManager()
core.debug(`sdkmanager installed to: ${sdkManager}`)
await callSdkManager(sdkManager, '--licenses')
await callSdkManager(sdkManager, 'tools')
await callSdkManager(sdkManager, 'platform-tools')
const sdkManagerExe = await installSdkManager()
core.setOutput('ANDROID_COMMANDLINE_TOOLS_VERSION', COMMANDLINE_TOOLS_VERSION)
if (core.getBooleanInput('accept-android-sdk-licenses')) {
core.info('Accepting Android SDK licenses')
await callSdkManager(
sdkManagerExe,
'--licenses',
core.getBooleanInput('log-accepted-android-sdk-licenses')
)
}
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
})
for (const pkg of packages) {
await callSdkManager(sdkManagerExe, pkg)
}
core.setOutput('ANDROID_COMMANDLINE_TOOLS_VERSION', VERSION_LONG)
core.exportVariable('ANDROID_HOME', ANDROID_SDK_ROOT)
core.exportVariable('ANDROID_SDK_ROOT', ANDROID_SDK_ROOT)
core.addPath(path.dirname(sdkManager))
core.addPath(path.dirname(sdkManagerExe))
core.addPath(path.join(ANDROID_SDK_ROOT, 'platform-tools'))
core.debug('add matchers')

View File

@@ -6,7 +6,8 @@
"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'. */
"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"]
}