Unverified Commit 7dbccc66 authored by Bruno Borges's avatar Bruno Borges Committed by GitHub
Browse files

Rename jdkFile input to jdk-file with deprecated alias (#1083)

* Rename jdkFile input to jdk-file with deprecated alias

Add a standardized `jdk-file` input to match the lowercase-dash naming
used by every other action input. The camelCase `jdkFile` input is kept
as a deprecated alias: it still works, but emits a deprecation warning and
may be removed in a future release. `jdk-file` takes precedence when both
are provided.

Updates docs and the local-file e2e workflow (one case intentionally keeps
using the deprecated alias for coverage) and regenerates the dist bundles.

Fixes #1077

Co-authored-by: default avatarCopilot App <[email protected]>

* docs: keep jdkFile in switching-to-v2 guide

The switching-to-v2 migration guide uses actions/setup-java@v2, which only supports the camelCase jdkFile input. Keep the new jdk-file spelling in current-version docs only.

Co-authored-by: default avatarCopilot App <[email protected]>

---------

Co-authored-by: default avatarCopilot App <[email protected]>
parent 8a3e8157
Loading
Loading
Loading
Loading
+3 −2
Changes for .github/workflows/e2e-local-file.yml: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ jobs:
        id: setup-java
        with:
          distribution: 'jdkfile'
          jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
          jdk-file: ${{ runner.temp }}/${{ env.LocalFilename }}
          java-version: '11.0.0-ea'
          architecture: x64
      - name: Verify Java version
@@ -88,7 +88,7 @@ jobs:
        id: setup-java
        with:
          distribution: 'jdkfile'
          jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
          jdk-file: ${{ runner.temp }}/${{ env.LocalFilename }}
          java-version: '11.0.0-ea'
          architecture: x64
      - name: Verify Java version
@@ -129,6 +129,7 @@ jobs:
        id: setup-java
        with:
          distribution: 'jdkfile'
          # Intentionally uses the deprecated `jdkFile` alias to keep it covered.
          jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
          java-version: '11.0.0-ea'
          architecture: x64
+1 −1
Changes for README.md: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ For more details, see the full release notes on the [releases page](https://git

  - `architecture`: The target architecture of the package. Possible values: `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`. Default value: Derived from the runner machine.

  - `jdkFile`: If a use-case requires a custom distribution setup-java uses the compressed JDK from the location pointed by this input and will take care of the installation and caching on the VM. Note: `distribution` must be set to 'jdkfile' (case-sensitive; all lowercase) when using this option.
  - `jdk-file`: If a use-case requires a custom distribution setup-java uses the compressed JDK from the location pointed by this input and will take care of the installation and caching on the VM. Note: `distribution` must be set to 'jdkfile' (case-sensitive; all lowercase) when using this option. (The camelCase `jdkFile` input is still accepted as a deprecated alias and may be removed in a future release.)

  - `check-latest`: Setting this option makes the action to check for the latest available version for the version spec.

+5 −1
Changes for action.yml: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -19,9 +19,13 @@ inputs:
  architecture:
    description: "The architecture of the package (defaults to the action runner's architecture)"
    required: false
  jdkFile:
  jdk-file:
    description: 'Path to where the compressed JDK is located'
    required: false
  jdkFile:
    description: 'Deprecated alias for `jdk-file`. Path to where the compressed JDK is located. Use `jdk-file` instead; this alias may be removed in a future release.'
    required: false
    deprecationMessage: 'The `jdkFile` input is deprecated. Use `jdk-file` instead.'
  check-latest:
    description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec'
    required: false
+2 −1
Changes for dist/cleanup/index.js: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -95834,7 +95834,8 @@ const INPUT_JAVA_VERSION_FILE = 'java-version-file';
const INPUT_ARCHITECTURE = 'architecture';
const INPUT_JAVA_PACKAGE = 'java-package';
const INPUT_DISTRIBUTION = 'distribution';
const INPUT_JDK_FILE = 'jdkFile';
const INPUT_JDK_FILE = 'jdk-file';
const INPUT_JDK_FILE_DEPRECATED = 'jdkFile';
const INPUT_CHECK_LATEST = 'check-latest';
const INPUT_SET_DEFAULT = 'set-default';
const INPUT_VERIFY_SIGNATURE = 'verify-signature';
+11 −2
Changes for dist/setup/index.js: 11 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -73279,7 +73279,8 @@ const INPUT_JAVA_VERSION_FILE = 'java-version-file';
const INPUT_ARCHITECTURE = 'architecture';
const INPUT_JAVA_PACKAGE = 'java-package';
const INPUT_DISTRIBUTION = 'distribution';
const INPUT_JDK_FILE = 'jdkFile';
const INPUT_JDK_FILE = 'jdk-file';
const INPUT_JDK_FILE_DEPRECATED = 'jdkFile';
const INPUT_CHECK_LATEST = 'check-latest';
const INPUT_SET_DEFAULT = 'set-default';
const INPUT_VERIFY_SIGNATURE = 'verify-signature';
@@ -133513,7 +133514,7 @@ async function run() {
        const versionFile = getInput(INPUT_JAVA_VERSION_FILE);
        const architecture = getInput(INPUT_ARCHITECTURE);
        const packageType = getInput(INPUT_JAVA_PACKAGE);
        const jdkFile = getInput(INPUT_JDK_FILE);
        const jdkFile = getJdkFileInput();
        const cache = getInput(INPUT_CACHE);
        const cacheDependencyPath = getInput(INPUT_CACHE_DEPENDENCY_PATH);
        const checkLatest = util_getBooleanInput(INPUT_CHECK_LATEST, false);
@@ -133591,6 +133592,14 @@ async function run() {
    }
}
run();
function getJdkFileInput() {
    const jdkFile = getInput(INPUT_JDK_FILE);
    const deprecatedJdkFile = getInput(INPUT_JDK_FILE_DEPRECATED);
    if (deprecatedJdkFile) {
        warning(`The '${INPUT_JDK_FILE_DEPRECATED}' input is deprecated and may be removed in a future release. Please use '${INPUT_JDK_FILE}' instead.`);
    }
    return jdkFile || deprecatedJdkFile;
}
async function installVersion(version, options, toolchainId = 0) {
    const { distributionName, jdkFile, architecture, packageType, checkLatest, setDefault, verifySignature, verifySignaturePublicKey, toolchainIds } = options;
    const installerOptions = {
Loading