Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13889,6 +13889,10 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
if (!this.stable) {
throw new Error('Early access versions are not supported');
}
if (this.packageType !== 'jdk') {
this.packageType = 'jdk';
core.warning('Microsoft Build of OpenJDK always uses the `jdk` package type. Remove the `java-package` argument when calling the action to silence this warning.');
}
const availableVersionsRaw = yield this.getAvailableVersions();
const opts = this.getPlatformOption();
const availableVersions = availableVersionsRaw.map(item => ({
Expand Down
11 changes: 11 additions & 0 deletions docs/advanced-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ steps:
- run: java -cp java HelloWorldApp
```

### Microsoft
```yaml
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'microsoft'
java-version: '11'
- run: java -cp java HelloWorldApp
```

## Installing custom Java package type
```yaml
steps:
Expand Down
7 changes: 7 additions & 0 deletions src/distributions/microsoft/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ export class MicrosoftDistributions extends JavaBase {
throw new Error('Early access versions are not supported');
}

if (this.packageType !== 'jdk') {
Comment thread
brcrista marked this conversation as resolved.
this.packageType = 'jdk';
core.warning(
'Microsoft Build of OpenJDK always uses the `jdk` package type. Remove the `java-package` argument when calling the action to silence this warning.'
);
}

const availableVersionsRaw = await this.getAvailableVersions();

const opts = this.getPlatformOption();
Expand Down