Skip to content

Commit

Permalink
add windows case
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams committed Jul 28, 2020
1 parent b97e00c commit cf3e355
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
uses: ./
with:
java-version: 13.0.2
vendor: adoptopenjdk
distro: adoptopenjdk
- name: Verify Java 13
if: runner.os != 'windows'
run: __tests__/verify-java.sh 13.0.2 "${{ steps.setup-java-adopt.outputs.path }}" "${{ steps.setup-java-adopt.outputs.version }}"
Expand All @@ -66,7 +66,7 @@ jobs:
uses: ./
with:
java-version: 13.0.2
vendor: zulu
distro: zulu
- name: Verify Java 13
if: runner.os != 'windows'
run: __tests__/verify-java.sh 13.0.2 "${{ steps.setup-java-zulu.outputs.path }}" "${{ steps.setup-java-zulu.outputs.version }}"
Expand Down Expand Up @@ -94,9 +94,9 @@ jobs:
uses: ./
with:
java-version: 13
vendor: 'adoptopenjdk'
distro: 'adoptopenjdk'
- name: Verify Java 13
run: __tests__/verify-java.sh 13.0.2
run: __tests__/verify-java.sh 13.0.2 "${{ steps.setup-java.outputs.path }}" "${{ steps.setup-java.outputs.version }}"


test-proxy-zulu:
Expand All @@ -120,7 +120,7 @@ jobs:
uses: ./
with:
java-version: 13.0.2
vendor: zulu
distro: zulu
- name: Verify Java 13
run: __tests__/verify-java.sh 13.0.2 "${{ steps.setup-java.outputs.path }}" "${{ steps.setup-java.outputs.version }}"

Expand All @@ -138,6 +138,6 @@ jobs:
uses: ./
with:
java-version: 13.0.2
vendor: zulu
distro: zulu
- name: Verify Java 13
run: __tests__/verify-java.sh 13.0.2 "${{ steps.setup-java.outputs.path }}" "${{ steps.setup-java.outputs.version }}"
6 changes: 4 additions & 2 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17461,6 +17461,9 @@ function getJavaAdoptOpenJDK(version, javaPackage, arch) {
case 'darwin':
OS = 'mac';
break;
case 'win32':
OS = 'windows';
break;
}
const http = new httpm.HttpClient('setup-java', undefined, {
allowRetries: true,
Expand Down Expand Up @@ -28769,13 +28772,12 @@ function run() {
if (!version) {
version = core.getInput(constants.INPUT_JAVA_VERSION, { required: true });
}
const vendor = core.getInput('vendor', { required: true });
const arch = core.getInput(constants.INPUT_ARCHITECTURE, { required: true });
const javaPackage = core.getInput(constants.INPUT_JAVA_PACKAGE, {
required: true
});
const jdkFile = core.getInput(constants.INPUT_JDK_FILE, { required: false });
const distro = core.getInput('vendor', { required: true });
const distro = core.getInput('distro', { required: true });
yield installer.getJava(version, distro, arch, jdkFile, javaPackage);
const matchersPath = path.join(__dirname, '..', '..', '.github');
core.info(`##[add-matcher]${path.join(matchersPath, 'java.json')}`);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"main": "dist/index.js",
"scripts": {
"build": "ncc build -o dist/setup src/setup-java.ts && ncc build -o dist/cleanup src/cleanup-java.ts",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"format": "prettier --write **/*.ts src/distro/*.ts",
"format-check": "prettier --check **/*.ts src/distro/*.ts",
"prerelease": "npm run-script build",
"release": "git add -f dist/setup/index.js dist/cleanup/index.js",
"test": "jest"
Expand Down
5 changes: 4 additions & 1 deletion src/distro/adoptopenjdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ export async function getJavaAdoptOpenJDK(

let OS = process.platform.toString();

switch(process.platform) {
switch (process.platform) {
case 'darwin':
OS = 'mac';
break;
case 'win32':
OS = 'windows';
break;
}

const http = new httpm.HttpClient('setup-java', undefined, {
Expand Down
3 changes: 1 addition & 2 deletions src/setup-java.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ async function run() {
if (!version) {
version = core.getInput(constants.INPUT_JAVA_VERSION, {required: true});
}
const vendor = core.getInput('vendor', {required: true});
const arch = core.getInput(constants.INPUT_ARCHITECTURE, {required: true});
const javaPackage = core.getInput(constants.INPUT_JAVA_PACKAGE, {
required: true
});
const jdkFile = core.getInput(constants.INPUT_JDK_FILE, {required: false});
const distro = core.getInput('vendor', {required: true});
const distro = core.getInput('distro', {required: true});

await installer.getJava(version, distro, arch, jdkFile, javaPackage);

Expand Down

0 comments on commit cf3e355

Please sign in to comment.