8 Commits

Author SHA1 Message Date
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
13 changed files with 27255 additions and 37739 deletions

View File

@@ -1,3 +0,0 @@
dist/
lib/
node_modules/

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
}
}

View File

@@ -9,12 +9,12 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Setup node 20 - name: Setup node 24
uses: actions/setup-node@v4 uses: actions/setup-node@v6
with: with:
node-version: 20 node-version: 24
- run: npm ci - run: npm ci
@@ -26,12 +26,12 @@ jobs:
format-check: format-check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Setup node 20 - name: Setup node 24
uses: actions/setup-node@v4 uses: actions/setup-node@v6
with: with:
node-version: 20 node-version: 24
- run: npm ci - run: npm ci
@@ -40,12 +40,12 @@ jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Setup node 20 - name: Setup node 24
uses: actions/setup-node@v4 uses: actions/setup-node@v6
with: with:
node-version: 20 node-version: 24
- run: npm ci - run: npm ci
@@ -60,13 +60,13 @@ jobs:
os: os:
- ubuntu-24.04 - ubuntu-24.04
- ubuntu-22.04 - ubuntu-22.04
- ubuntu-20.04 - macos-26
- macos-15
- macos-14 - macos-14
- macos-13 - windows-2025
- macos-12
- windows-2022 - windows-2022
- windows-2019
cmdline-tools-version: cmdline-tools-version:
- 14742923
- 12266719 - 12266719
- 11479570 - 11479570
- 11076708 - 11076708
@@ -76,15 +76,15 @@ jobs:
- 9123335 - 9123335
- 8512546 - 8512546
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Setup node 20 - name: Setup node 24
uses: actions/setup-node@v4 uses: actions/setup-node@v6
with: with:
node-version: 20 node-version: 24
- name: Set up JDK 17 - name: Set up JDK 17
uses: actions/setup-java@v4 uses: actions/setup-java@v5
with: with:
java-version: 17 java-version: 17
distribution: 'temurin' distribution: 'temurin'
@@ -105,12 +105,12 @@ jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Setup node 20 - name: Setup node 24
uses: actions/setup-node@v4 uses: actions/setup-node@v6
with: with:
node-version: 20 node-version: 24
- run: npm ci - run: npm ci

View File

@@ -31,13 +31,13 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v5
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v3 uses: github/codeql-action/init@v4
with: with:
languages: 'javascript' languages: 'javascript'
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3 uses: github/codeql-action/analyze@v4

View File

@@ -20,16 +20,16 @@ jobs:
if: ${{ false }} if: ${{ false }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
with: with:
repository: daveol/SampleApplication repository: daveol/SampleApplication
- uses: actions/checkout@v4 - uses: actions/checkout@v5
with: with:
path: ./build/ path: ./build/
- name: Set up JDK 17 - name: Set up JDK 17
uses: actions/setup-java@v4 uses: actions/setup-java@v5
with: with:
java-version: 17 java-version: 17
distribution: 'temurin' distribution: 'temurin'

View File

@@ -26,7 +26,7 @@ steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up JDK 17 - name: Set up JDK 17
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
java-version: '17' java-version: '17'
distribution: 'temurin' distribution: 'temurin'
@@ -61,7 +61,7 @@ Additional packages can be installed at a later time by calling sdkmanager manua
Command line tools are versioned using two variables - short and long. 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. 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). By default, setup-android installs version 14742923 (short version 20.0).
To install a different version, call setup-android with desired long version as the input parameter `cmdline-tools-version`: To install a different version, call setup-android with desired long version as the input parameter `cmdline-tools-version`:
```yaml ```yaml
@@ -74,6 +74,7 @@ To install a different version, call setup-android with desired long version as
#### Version table #### Version table
| Short version | Long version | | Short version | Long version |
|---------------| --- | |---------------| --- |
| 20.0 | 14742923 |
| 16.0 | 12266719 | | 16.0 | 12266719 |
| 13.0 | 11479570 | | 13.0 | 11479570 |
| 12.0 | 11076708 | | 12.0 | 11076708 |

View File

@@ -6,7 +6,7 @@ inputs:
cmdline-tools-version: cmdline-tools-version:
description: 'cmdline-tools-version. See https://developer.android.com/studio#command-line-tools-only' description: 'cmdline-tools-version. See https://developer.android.com/studio#command-line-tools-only'
required: false required: false
default: '12266719' default: '14742923'
accept-android-sdk-licenses: 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"' description: 'Android SDK is usable only after the license agreement. Should setup-android agree to the licences, provided by "sdkmanager --licenses"'
@@ -24,7 +24,7 @@ inputs:
default: 'tools platform-tools' default: 'tools platform-tools'
runs: runs:
using: node20 using: node24
main: 'dist/index.js' main: 'dist/index.js'
branding: branding:

49353
dist/index.js vendored

File diff suppressed because one or more lines are too long

70
eslint.config.js Normal file
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',
},
},
];

12198
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
"description": "setup android action", "description": "setup android action",
"main": "lib/main.js", "main": "lib/main.js",
"scripts": { "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": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts", "format-check": "prettier --check **/*.ts",
"lint": "eslint src/*.ts", "lint": "eslint src/*.ts",
@@ -25,24 +25,24 @@
"author": "daveol", "author": "daveol",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@actions/cache": "^3.2.4", "@actions/core": "^3.0.0",
"@actions/core": "^1.10.1", "@actions/tool-cache": "^4.0.0"
"@actions/tool-cache": "^2.0.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.5", "@types/jest": "^30.0.0",
"@types/node": "^20.6.5", "@types/node": "^24.0.0",
"@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/eslint-plugin": "^8.57.2",
"@typescript-eslint/parser": "^7.18.0", "@typescript-eslint/parser": "^8.57.2",
"@vercel/ncc": "^0.38.0", "esbuild": "^0.27.4",
"eslint": "^8.57.0", "eslint": "^10.1.0",
"eslint-plugin-github": "^5.0.1", "eslint-plugin-check-file": "^3.3.1",
"eslint-plugin-jest": "^28.6.0", "eslint-plugin-jest": "^29.15.1",
"jest": "^29.7.0", "globals": "^17.4.0",
"jest-circus": "^29.7.0", "jest": "^30.3.0",
"jest-circus": "^30.3.0",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"prettier": "^3.3.2", "prettier": "^3.3.2",
"ts-jest": "^29.1.5", "ts-jest": "^29.1.5",
"typescript": "^5.5.4" "typescript": "^5.9.3"
} }
} }

View File

@@ -7,6 +7,8 @@ import * as os from 'os'
function getVersionShort(versionLong: string): string { function getVersionShort(versionLong: string): string {
switch (versionLong) { switch (versionLong) {
case '14742923':
return '20.0'
case '12266719': case '12266719':
return '16.0' return '16.0'
case '11479570': case '11479570':
@@ -185,7 +187,6 @@ async function run(): Promise<void> {
core.addPath(path.join(ANDROID_SDK_ROOT, 'platform-tools')) core.addPath(path.join(ANDROID_SDK_ROOT, 'platform-tools'))
core.debug('add matchers') core.debug('add matchers')
// eslint-disable-next-line no-console
console.log(`##[add-matcher]${path.join(__dirname, '..', 'matchers.json')}`) console.log(`##[add-matcher]${path.join(__dirname, '..', 'matchers.json')}`)
} }

View File

@@ -1,13 +1,24 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ "target": "ES2024",
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ "module": "es2022",
"outDir": "./lib", /* Redirect output structure to the directory. */ "moduleResolution": "bundler",
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ "lib": [
"strict": true, /* Enable all strict type-checking options. */ "ES2024"
"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'. */ "outDir": "./lib",
"moduleResolution": "node" "rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true
}, },
"exclude": ["node_modules", "**/*.test.ts"] "exclude": [
"node_modules",
"**/*.test.ts",
"lib"
]
} }