Compare commits

..

1 Commits

Author SHA1 Message Date
Dmitry Shibanov
91d3aa4956 Update actions/core for releases/v2 (#466) 2023-03-28 12:09:52 +02:00
32 changed files with 33372 additions and 39007 deletions

9
.github/workflows/build.yml vendored Normal file → Executable file
View File

@@ -19,12 +19,11 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Setup Node.JS 16
uses: actions/setup-node@v3
- uses: actions/checkout@v2
- name: Setup Node.JS 12
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: npm
node-version: 12.x
- run: npm ci
- run: npm run build
- run: npm run format-check

View File

@@ -21,13 +21,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Set Node.js 16.x
uses: actions/setup-node@v3
- name: Set Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 16.x
cache: npm
node-version: 12.x
- name: Install dependencies
run: npm ci
@@ -45,7 +44,7 @@ jobs:
id: diff
# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v2
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist

View File

@@ -23,7 +23,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Run setup-java with the cache for gradle
uses: ./
id: setup-java
@@ -49,7 +49,7 @@ jobs:
needs: gradle-save
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Run setup-java with the cache for gradle
uses: ./
id: setup-java
@@ -72,7 +72,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Run setup-java with the cache for maven
uses: ./
id: setup-java
@@ -96,7 +96,7 @@ jobs:
needs: maven-save
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Run setup-java with the cache for maven
uses: ./
id: setup-java

View File

@@ -20,7 +20,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Download Adopt OpenJDK file
run: |
if ($IsLinux) {
@@ -57,7 +57,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Download Zulu OpenJDK file
run: |
if ($IsLinux) {
@@ -94,7 +94,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Download Eclipse Temurin file
run: |
if ($IsLinux) {

View File

@@ -24,7 +24,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: setup-java
uses: ./
id: setup-java
@@ -59,7 +59,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Create fake settings.xml
run: |
$xmlDirectory = Join-Path $HOME ".m2"
@@ -95,7 +95,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Create fake settings.xml
run: |
$xmlDirectory = Join-Path $HOME ".m2"
@@ -132,7 +132,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: setup-java
uses: ./
id: setup-java

View File

@@ -27,7 +27,7 @@ jobs:
version: 8
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: setup-java
uses: ./
id: setup-java
@@ -53,7 +53,7 @@ jobs:
- '16.0.2+7'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: setup-java
uses: ./
id: setup-java
@@ -75,7 +75,7 @@ jobs:
distribution: ['temurin', 'zulu', 'liberica']
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: setup-java
uses: ./
id: setup-java
@@ -98,7 +98,7 @@ jobs:
version: ['17-ea', '15.0.0-ea.14']
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: setup-java
uses: ./
id: setup-java
@@ -120,7 +120,7 @@ jobs:
version: ['17-ea']
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: setup-java
uses: ./
id: setup-java
@@ -165,7 +165,7 @@ jobs:
java-package: 'jre'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: setup-java
uses: ./
id: setup-java
@@ -191,7 +191,7 @@ jobs:
version: ['11']
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: setup-java
uses: ./
id: setup-java

View File

@@ -14,12 +14,12 @@ jobs:
runs-on: ubuntu-latest
name: Check licenses
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- run: npm ci
- name: Install licensed
run: |
cd $RUNNER_TEMP
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.4.4/licensed-3.4.4-linux-x64.tar.gz
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.3.1/licensed-3.3.1-linux-x64.tar.gz
sudo tar -xzf licensed.tar.gz
sudo mv licensed /usr/local/bin/licensed
- run: licensed status

View File

@@ -1,6 +1,6 @@
---
name: "@actions/cache"
version: 2.0.2
version: 1.0.8
type: npm
summary: Actions cache lib
homepage: https://github.com/actions/toolkit/tree/main/packages/cache

View File

@@ -1,6 +1,6 @@
---
name: "@actions/core"
version: 1.2.6
version: 1.10.0
type: npm
summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/main/packages/core

View File

@@ -0,0 +1,32 @@
---
name: "@actions/http-client"
version: 2.1.0
type: npm
summary: Actions Http Client
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
license: mit
licenses:
- sources: LICENSE
text: |
Actions Http Client for Node.js
Copyright (c) GitHub, Inc.
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []

View File

@@ -1,32 +1,32 @@
---
name: "@azure/core-asynciterator-polyfill"
version: 1.0.2
version: 1.0.0
type: npm
summary: Polyfill for IE/Node 8 for Symbol.asyncIterator
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-asynciterator-polyfill/README.md
homepage: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-asynciterator-polyfill
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
text: |2
MIT License
Copyright (c) 2020 Microsoft
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
notices: []

View File

@@ -1,6 +1,6 @@
---
name: "@azure/core-http"
version: 2.2.4
version: 2.2.2
type: npm
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
libraries generated using AutoRest

View File

@@ -1,6 +1,6 @@
---
name: "@azure/core-lro"
version: 2.2.4
version: 2.2.1
type: npm
summary: Isomorphic client library for supporting long-running operations in node.js
and browser.

View File

@@ -1,6 +1,6 @@
---
name: "@azure/core-paging"
version: 1.2.1
version: 1.2.0
type: npm
summary: Core types for paging async iterable iterators
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-paging/README.md

View File

@@ -1,6 +1,6 @@
---
name: "@azure/ms-rest-js"
version: 2.6.1
version: 2.6.0
type: npm
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
libraries generated using AutoRest

View File

@@ -1,6 +1,6 @@
---
name: "@azure/storage-blob"
version: 12.9.0
version: 12.8.0
type: npm
summary: Microsoft Azure Storage SDK for JavaScript - Blob
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/

View File

@@ -1,6 +1,6 @@
---
name: "@opentelemetry/api"
version: 1.0.4
version: 1.0.3
type: npm
summary: Public API for OpenTelemetry
homepage: https://github.com/open-telemetry/opentelemetry-js-api#readme
@@ -218,6 +218,10 @@ licenses:
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
[license-url]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js-api.svg
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-api
[devDependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js-api.svg?type=dev
[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-api?type=dev
[npm-url]: https://www.npmjs.com/package/@opentelemetry/api
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fapi.svg
[docs-tracing]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/docs/tracing.md

View File

@@ -1,9 +1,9 @@
---
name: "@types/node"
version: 16.11.25
version: 12.20.4
type: npm
summary: TypeScript definitions for Node.js
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped#readme
license: mit
licenses:
- sources: LICENSE

View File

@@ -1,6 +1,6 @@
---
name: "@types/node-fetch"
version: 2.6.1
version: 2.5.12
type: npm
summary: TypeScript definitions for node-fetch
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch

View File

@@ -1,6 +1,6 @@
---
name: node-fetch
version: 2.6.7
version: 2.6.6
type: npm
summary: A light-weight module that brings window.fetch to node.js
homepage: https://github.com/bitinn/node-fetch

View File

@@ -25,8 +25,8 @@ Inputs `java-version` and `distribution` are mandatory. See [Supported distribut
**Eclipse Temurin**
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
@@ -36,8 +36,8 @@ steps:
**Zulu OpenJDK**
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '11'
@@ -66,19 +66,13 @@ Currently, the following distributions are supported:
**NOTE:** Adopt OpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from `adopt` to `temurin` to keep receiving software and security updates. See more details in the [Good-bye AdoptOpenJDK post](https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/).
### Caching packages dependencies
The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are gradle and maven. The format of the used cache key is `setup-java-${{ platform }}-${{ packageManager }}-${{ fileHash }}`, where the hash is based on the following files:
- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`
- maven: `**/pom.xml`
The workflow output `cache-hit` is set to indicate if an exact match was found for the key [as actions/cache does](https://github.com/actions/cache/tree/main#outputs).
The cache input is optional, and caching is turned off by default.
The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are gradle and maven. The cache input is optional, and caching is turned off by default.
#### Caching gradle dependencies
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
@@ -89,8 +83,8 @@ steps:
#### Caching maven dependencies
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
@@ -109,8 +103,8 @@ For Java distributions that are not cached on Hosted images, `check-latest` alwa
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
@@ -128,9 +122,9 @@ jobs:
java: [ '8', '11', '13', '15' ]
name: Java ${{ matrix.Java }} sample
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v3
uses: actions/setup-java@v2
with:
distribution: '<distribution>'
java-version: ${{ matrix.java }}

View File

@@ -1,9 +1,4 @@
import * as cache from '@actions/cache';
import * as core from '@actions/core';
import { isVersionSatisfies, isCacheFeatureAvailable } from '../src/util';
jest.mock('@actions/cache');
jest.mock('@actions/core');
import { isVersionSatisfies } from '../src/util';
describe('isVersionSatisfies', () => {
it.each([
@@ -25,38 +20,3 @@ describe('isVersionSatisfies', () => {
expect(actual).toBe(expected);
});
});
describe('isCacheFeatureAvailable', () => {
it('isCacheFeatureAvailable disabled on GHES', () => {
jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => false);
try {
process.env['GITHUB_SERVER_URL'] = 'http://example.com';
isCacheFeatureAvailable();
} catch (error) {
expect(error).toHaveProperty(
'message',
'Caching is only supported on GHES version >= 3.5. If you are on a version >= 3.5, please check with your GHES admin if the Actions cache service is enabled or not.'
);
} finally {
delete process.env['GITHUB_SERVER_URL'];
}
});
it('isCacheFeatureAvailable disabled on dotcom', () => {
jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => false);
const infoMock = jest.spyOn(core, 'warning');
const message = 'The runner was not able to contact the cache service. Caching will be skipped';
try {
process.env['GITHUB_SERVER_URL'] = 'http://github.com';
expect(isCacheFeatureAvailable()).toBe(false);
expect(infoMock).toHaveBeenCalledWith(message);
} finally {
delete process.env['GITHUB_SERVER_URL'];
}
});
it('isCacheFeatureAvailable is enabled', () => {
jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => true);
expect(isCacheFeatureAvailable()).toBe(true);
});
});

View File

@@ -67,6 +67,6 @@ outputs:
path:
description: 'Path to where the java environment has been installed (same as $JAVA_HOME)'
runs:
using: 'node16'
using: 'node12'
main: 'dist/setup/index.js'
post: 'dist/cleanup/index.js'

8233
dist/cleanup/index.js vendored

File diff suppressed because it is too large Load Diff

57041
dist/setup/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -20,8 +20,8 @@ Inputs `java-version` and `distribution` are mandatory and needs to be provided.
### Eclipse Temurin
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
@@ -33,8 +33,8 @@ steps:
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt-hotspot'
java-version: '11'
@@ -44,8 +44,8 @@ steps:
### Zulu
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
@@ -56,8 +56,8 @@ steps:
### Liberica
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'liberica'
java-version: '11'
@@ -68,8 +68,8 @@ steps:
### Microsoft
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'microsoft'
java-version: '11'
@@ -79,8 +79,8 @@ steps:
## Installing custom Java package type
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: '<distribution>'
java-version: '11'
@@ -93,8 +93,8 @@ steps:
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: '<distribution>'
java-version: '11'
@@ -110,7 +110,7 @@ steps:
- run: |
download_url="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.10_9.tar.gz"
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
- uses: actions/setup-java@v3
- uses: actions/setup-java@v2
with:
distribution: 'jdkfile'
jdkFile: ${{ runner.temp }}/java_package.tar.gz
@@ -132,9 +132,9 @@ jobs:
java: [ '8', '11' ]
name: Java ${{ matrix.Java }} (${{ matrix.distribution }}) sample
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v3
uses: actions/setup-java@v2
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
@@ -152,9 +152,9 @@ jobs:
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
name: Java ${{ matrix.Java }} (${{ matrix.os }}) sample
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v3
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
@@ -169,9 +169,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v2
with:
distribution: '<distribution>'
java-version: '11'
@@ -185,7 +185,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password
- name: Set up Apache Maven Central
uses: actions/setup-java@v3
uses: actions/setup-java@v2
with: # running setup-java again overwrites the settings.xml
distribution: 'temurin'
java-version: '11'
@@ -280,9 +280,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Set up JDK 11 for Shared Runner
uses: actions/setup-java@v3
uses: actions/setup-java@v2
with:
distribution: '<distribution>'
java-version: '11'
@@ -306,10 +306,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v2
with:
distribution: '<distribution>'
java-version: '11'

6775
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "setup-java",
"version": "3.1.1",
"version": "2.0.0",
"private": true,
"description": "setup java action",
"main": "dist/setup/index.js",
@@ -24,8 +24,8 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "^2.0.2",
"@actions/core": "^1.2.6",
"@actions/cache": "^1.0.8",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.0.4",
"@actions/glob": "^0.2.0",
"@actions/http-client": "^1.0.11",
@@ -36,7 +36,7 @@
},
"devDependencies": {
"@types/jest": "^27.0.2",
"@types/node": "^16.11.25",
"@types/node": "^12.19.13",
"@types/semver": "^7.3.4",
"@zeit/ncc": "^0.20.5",
"jest": "^27.2.5",
@@ -44,5 +44,11 @@
"prettier": "^1.19.1",
"ts-jest": "^27.0.5",
"typescript": "^4.2.3"
},
"husky": {
"skipCI": true,
"hooks": {
"pre-commit": "npm run build && npm run format"
}
}
}

View File

@@ -77,10 +77,8 @@ export async function restore(id: string) {
]);
if (matchedKey) {
core.saveState(CACHE_MATCHED_KEY, matchedKey);
core.setOutput('cache-hit', matchedKey === primaryKey);
core.info(`Cache restored from key: ${matchedKey}`);
} else {
core.setOutput('cache-hit', false);
core.info(`${packageManager.id} cache is not found`);
}
}

View File

@@ -1,6 +1,6 @@
import * as core from '@actions/core';
import * as auth from './auth';
import { getBooleanInput, isCacheFeatureAvailable } from './util';
import { getBooleanInput } from './util';
import * as constants from './constants';
import { restore } from './cache';
import * as path from 'path';
@@ -42,7 +42,7 @@ async function run() {
core.info(`##[add-matcher]${path.join(matchersPath, 'java.json')}`);
await auth.configureAuthentication();
if (cache && isCacheFeatureAvailable()) {
if (cache) {
await restore(cache);
}
} catch (error) {

View File

@@ -2,7 +2,6 @@ import os from 'os';
import path from 'path';
import * as fs from 'fs';
import * as semver from 'semver';
import * as cache from '@actions/cache';
import * as core from '@actions/core';
import * as tc from '@actions/tool-cache';
@@ -78,24 +77,3 @@ export function isJobStatusSuccess() {
return jobStatus === 'success';
}
export function isGhes(): boolean {
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
}
export function isCacheFeatureAvailable(): boolean {
if (!cache.isFeatureAvailable()) {
if (isGhes()) {
throw new Error(
'Caching is only supported on GHES version >= 3.5. If you are on a version >= 3.5, please check with your GHES admin if the Actions cache service is enabled or not.'
);
} else {
core.warning('The runner was not able to contact the cache service. Caching will be skipped');
}
return false;
}
return true;
}