Compare commits

..

No commits in common. "bd0d2b8f65c9ce06e9dd38fa8dd60a82e7d27e64" and "4e56c31b28053b7081e102121153633227d6dd8e" have entirely different histories.

4 changed files with 24 additions and 31 deletions

View File

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

8
dist/setup/index.js vendored
View File

@ -124592,12 +124592,11 @@ 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 (bearerToken) {
requestHeaders['Authorization'] = `Bearer ${bearerToken}`;
if (process.env.GITHUB_TOKEN) {
requestHeaders['Authorization'] = `Bearer ${process.env.GITHUB_TOKEN}`;
}
const rawUrl = `https://api.github.com/repos/JetBrains/JetBrainsRuntime/releases?${requestArguments}`;
if (core.isDebug() && page_index === 1) {
@ -124612,9 +124611,6 @@ 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,14 +174,7 @@ steps:
### JetBrains
**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.
**NOTE:** JetBrains is only available for LTS versions on 11 or later.
```yaml
steps:
@ -209,8 +202,7 @@ steps:
- run: java -cp java HelloWorldApp
```
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:
JetBrains Package Types (as shown in the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases/)):
- `jdk` - JBRSDK
- `jre` - JBR (Vanilla)

View File

@ -96,14 +96,12 @@ 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 (bearerToken) {
requestHeaders['Authorization'] = `Bearer ${bearerToken}`;
if (process.env.GITHUB_TOKEN) {
requestHeaders['Authorization'] = `Bearer ${process.env.GITHUB_TOKEN}`;
}
const rawUrl = `https://api.github.com/repos/JetBrains/JetBrainsRuntime/releases?${requestArguments}`;
@ -125,10 +123,6 @@ 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