Compare commits

..

3 Commits

Author SHA1 Message Date
Gregory Mitchell
bd0d2b8f65
Add Notices in Documentation 2024-11-28 19:43:32 +00:00
Gregory Mitchell
847079da47
Update jetbrains-installer Tests 2024-11-28 19:43:24 +00:00
Gregory Mitchell
393543671a
Add Hidden JDK 11 Versions 2024-11-28 19:43:01 +00:00
4 changed files with 31 additions and 24 deletions

View File

@ -25,22 +25,11 @@ describe('getAvailableVersions', () => {
it('load available versions', async () => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
spyHttpClient
.mockReturnValueOnce({
statusCode: 200,
headers: {},
result: manifestData as any
})
.mockReturnValueOnce({
statusCode: 200,
headers: {},
result: manifestData as any
})
.mockReturnValueOnce({
statusCode: 200,
headers: {},
result: []
});
spyHttpClient.mockReturnValueOnce({
statusCode: 200,
headers: {},
result: manifestData as any
});
const distribution = new JetBrainsDistribution({
version: '17',
@ -53,8 +42,8 @@ describe('getAvailableVersions', () => {
const length =
os.platform() === 'win32'
? manifestData.length * 2 - 4
: manifestData.length * 2;
? manifestData.length - 2
: manifestData.length + 1;
expect(availableVersions.length).toBe(length);
}, 10_000);
});

8
dist/setup/index.js vendored
View File

@ -124592,11 +124592,12 @@ class JetBrainsDistribution extends base_installer_1.JavaBase {
// GitHub API doesn't provide way to retrieve the count of pages to iterate so infinity loop
let page_index = 1;
const rawVersions = [];
const bearerToken = process.env.GITHUB_TOKEN;
while (true) {
const requestArguments = `per_page=100&page=${page_index}`;
const requestHeaders = {};
if (process.env.GITHUB_TOKEN) {
requestHeaders['Authorization'] = `Bearer ${process.env.GITHUB_TOKEN}`;
if (bearerToken) {
requestHeaders['Authorization'] = `Bearer ${bearerToken}`;
}
const rawUrl = `https://api.github.com/repos/JetBrains/JetBrainsRuntime/releases?${requestArguments}`;
if (core.isDebug() && page_index === 1) {
@ -124611,6 +124612,9 @@ class JetBrainsDistribution extends base_installer_1.JavaBase {
rawVersions.push(...paginationPage);
page_index++;
}
// Add versions not available from the API but are downloadable
const hidden = ['11_0_10b1145.115', '11_0_11b1341.60'];
rawVersions.push(...hidden.map(tag => ({ tag_name: tag, name: tag })));
const versions0 = rawVersions.map((v) => __awaiter(this, void 0, void 0, function* () {
var _a;
// Release tags look like one of these:

View File

@ -174,7 +174,14 @@ steps:
### JetBrains
**NOTE:** JetBrains is only available for LTS versions on 11 or later.
**NOTE:** JetBrains is only available for LTS versions on 11 or later (11, 17, 21, etc.).
Not all minor LTS versions are guarenteed to be available, since JetBrains considers what to ship IntelliJ IDEA with, most commonly on JDK 11.
For example, `11.0.24` is not available but `11.0.16` is.
Versions are based on the GitHub tag on the [JetBrains Runtime releases page](https://github.com/JetBrains/JetBrainsRuntime/releases). As such, some tags may be formatted with
underscores (`11_0_13`) and others with dots (`11.0.13`). Conversion is automatically applied to the dot version format, so `11.0.13` is equivalent to `11_0_13`. Dot format
is more encouraged for consistency, but both are supported.
```yaml
steps:
@ -202,7 +209,8 @@ steps:
- run: java -cp java HelloWorldApp
```
JetBrains Package Types (as shown in the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases/)):
You can specify your package type (as shown in the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases/)) in the `package-type` parameter.
The available package types are:
- `jdk` - JBRSDK
- `jre` - JBR (Vanilla)

View File

@ -96,12 +96,14 @@ export class JetBrainsDistribution extends JavaBase {
// GitHub API doesn't provide way to retrieve the count of pages to iterate so infinity loop
let page_index = 1;
const rawVersions: IJetBrainsRawVersion[] = [];
const bearerToken = process.env.GITHUB_TOKEN;
while (true) {
const requestArguments = `per_page=100&page=${page_index}`;
const requestHeaders: OutgoingHttpHeaders = {};
if (process.env.GITHUB_TOKEN) {
requestHeaders['Authorization'] = `Bearer ${process.env.GITHUB_TOKEN}`;
if (bearerToken) {
requestHeaders['Authorization'] = `Bearer ${bearerToken}`;
}
const rawUrl = `https://api.github.com/repos/JetBrains/JetBrainsRuntime/releases?${requestArguments}`;
@ -123,6 +125,10 @@ export class JetBrainsDistribution extends JavaBase {
page_index++;
}
// Add versions not available from the API but are downloadable
const hidden = ['11_0_10b1145.115', '11_0_11b1341.60'];
rawVersions.push(...hidden.map(tag => ({tag_name: tag, name: tag})));
const versions0 = rawVersions.map(async v => {
// Release tags look like one of these:
// jbr-release-21.0.3b465.3