Skip to content

Commit 2cf2d2f

Browse files
Release: v2.0.0
1 parent a76c8ff commit 2cf2d2f

13 files changed

Lines changed: 31 additions & 30 deletions

dist/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export declare function isAuthenticated(): Promise<boolean>;
7070
* specification is installed.
7171
* @returns The path of the installed tool.
7272
*/
73-
export declare function installGcloudSDK(version: string, skipToolCache?: boolean): Promise<string>;
73+
export declare function installGcloudSDK(version: string, useToolCache?: boolean): Promise<string>;
7474
/**
7575
* computeGcloudVersion computes the appropriate gcloud version for the given
7676
* string. If the string is the empty string or the special value "latest", it

dist/index.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41738,7 +41738,7 @@ async function isAuthenticated() {
4173841738
* specification is installed.
4173941739
* @returns The path of the installed tool.
4174041740
*/
41741-
async function installGcloudSDK(version, skipToolCache) {
41741+
async function installGcloudSDK(version, useToolCache = false) {
4174241742
// Retrieve the release corresponding to the specified version and OS
4174341743
const osPlat = os.platform();
4174441744
const osArch = os.arch();
@@ -41752,24 +41752,25 @@ async function installGcloudSDK(version, skipToolCache) {
4175241752
throw new Error(`Failed to download release, url: ${url}`);
4175341753
}
4175441754
// Either cache the tool or just add it directly to the path.
41755-
if (skipToolCache) {
41756-
// Caching the tool on disk takes a really long time, and it's not clear
41757-
// whether it's even valuable since it's ONLY cached on disk on the runner.
41758-
// For GitHub-managed runners, that is useless since they are ephemeral.
41759-
//
41760-
// See https://github.com/google-github-actions/setup-gcloud/issues/701 for
41761-
// discussion, but it's actually faster to skip the caching and just add the
41762-
// tool directly to the path.
41763-
const toolRoot = path.join(extPath, 'google-cloud-sdk');
41764-
core.addPath(path.join(toolRoot, 'bin'));
41765-
return toolRoot;
41766-
}
41767-
else {
41755+
//
41756+
// Caching the tool on disk takes a really long time, and it's not clear
41757+
// whether it's even valuable since it's ONLY cached on disk on the runner.
41758+
// For GitHub-managed runners, that is useless since they are ephemeral.
41759+
//
41760+
// See https://github.com/google-github-actions/setup-gcloud/issues/701 for
41761+
// discussion, but it's actually faster to skip the caching and just add the
41762+
// tool directly to the path.
41763+
if (useToolCache) {
4176841764
const toolRoot = path.join(extPath, 'google-cloud-sdk');
4176941765
const cachedToolRoot = await toolCache.cacheDir(toolRoot, 'gcloud', resolvedVersion, osArch);
4177041766
core.addPath(path.join(cachedToolRoot, 'bin'));
4177141767
return cachedToolRoot;
4177241768
}
41769+
else {
41770+
const toolRoot = path.join(extPath, 'google-cloud-sdk');
41771+
core.addPath(path.join(toolRoot, 'bin'));
41772+
return toolRoot;
41773+
}
4177341774
}
4177441775
/**
4177541776
* computeGcloudVersion computes the appropriate gcloud version for the given
@@ -43928,7 +43929,7 @@ module.exports = parseParams
4392843929
/***/ ((module) => {
4392943930

4393043931
"use strict";
43931-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@google-github-actions/setup-cloud-sdk","version":"1.2.2","description":"Utilities to download, install, and interact with the Cloud SDK for GitHub Actions","module":"dist/index.js","main":"dist/index.js","types":"dist/index.d.js","engines":{"node":">= 20.x","npm":">= 10.x"},"scripts":{"build":"rm -rf dist/ && ncc build --source-map --no-source-map-register src/index.ts","lint":"eslint .","format":"eslint --fix","docs":"rm -rf docs/ && typedoc --plugin typedoc-plugin-markdown","test":"node --require ts-node/register --test-reporter spec --test tests/download-util.test.ts tests/format-url.test.ts tests/index.test.ts"},"files":["dist/**/*"],"repository":{"type":"git","url":"git+https://github.com/google-github-actions/setup-cloud-sdk.git"},"keywords":["Cloud SDK","google cloud","gcloud"],"author":"Google LLC","license":"Apache-2.0","dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.1.1","@actions/http-client":"^2.2.3","@actions/tool-cache":"^2.0.2","@google-github-actions/actions-utils":"^0.8.9","semver":"^7.7.2"},"devDependencies":{"@eslint/eslintrc":"^3.3.1","@eslint/js":"^9.34.0","@types/node":"^24.3.0","@types/semver":"^7.7.0","@typescript-eslint/eslint-plugin":"^8.40.0","@vercel/ncc":"^0.38.3","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","eslint":"^9.34.0","prettier":"^3.6.2","ts-node":"^10.9.2","typedoc-plugin-markdown":"^4.8.1","typedoc":"^0.28.10","typescript-eslint":"^8.40.0","typescript":"^5.9.2"}}');
43932+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@google-github-actions/setup-cloud-sdk","version":"2.0.0","description":"Utilities to download, install, and interact with the Cloud SDK for GitHub Actions","module":"dist/index.js","main":"dist/index.js","types":"dist/index.d.js","engines":{"node":">= 24.x","npm":">= 11.x"},"scripts":{"build":"rm -rf dist/ && ncc build --source-map --no-source-map-register src/index.ts","lint":"eslint .","format":"eslint --fix","docs":"rm -rf docs/ && typedoc --plugin typedoc-plugin-markdown","test":"node --require ts-node/register --test-reporter spec --test tests/**/*.test.ts"},"files":["dist/**/*"],"repository":{"type":"git","url":"git+https://github.com/google-github-actions/setup-cloud-sdk.git"},"keywords":["Cloud SDK","google cloud","gcloud"],"author":"Google LLC","license":"Apache-2.0","dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.1.1","@actions/http-client":"^2.2.3","@actions/tool-cache":"^2.0.2","@google-github-actions/actions-utils":"^1.0.0","semver":"^7.7.2"},"devDependencies":{"@eslint/eslintrc":"^3.3.1","@eslint/js":"^9.34.0","@types/node":"^24.3.0","@types/semver":"^7.7.0","@typescript-eslint/eslint-plugin":"^8.40.0","@vercel/ncc":"^0.38.3","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","eslint":"^9.34.0","prettier":"^3.6.2","ts-node":"^10.9.2","typedoc-plugin-markdown":"^4.8.1","typedoc":"^0.28.10","typescript-eslint":"^8.40.0","typescript":"^5.9.2"}}');
4393243933

4393343934
/***/ })
4393443935

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index/functions/authenticateGcloudSDK.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **authenticateGcloudSDK**(`filepath`): `Promise`\<`void`\>
1010
11-
Defined in: [index.ts:235](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L235)
11+
Defined in: [index.ts:239](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L239)
1212

1313
Authenticates the gcloud tool using the provided credentials file.
1414

docs/index/functions/bestVersion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **bestVersion**(`spec`): `Promise`\<`string`\>
1010
11-
Defined in: [index.ts:282](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L282)
11+
Defined in: [index.ts:286](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L286)
1212

1313
bestVersion takes a version constraint and gets the latest available version
1414
that satisfies the constraint.

docs/index/functions/computeBestVersion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **computeBestVersion**(`spec`, `versions`): `string`
1010
11-
Defined in: [index.ts:321](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L321)
11+
Defined in: [index.ts:325](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L325)
1212

1313
computeBestVersion computes the latest available version that still satisfies
1414
the spec. This is a helper function and is only exported for testing.

docs/index/functions/computeGcloudVersion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **computeGcloudVersion**(`version?`): `Promise`\<`string`\>
1010
11-
Defined in: [index.ts:222](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L222)
11+
Defined in: [index.ts:226](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L226)
1212

1313
computeGcloudVersion computes the appropriate gcloud version for the given
1414
string. If the string is the empty string or the special value "latest", it

docs/index/functions/getLatestGcloudSDKVersion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **getLatestGcloudSDKVersion**(): `Promise`\<`string`\>
1010
11-
Defined in: [index.ts:271](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L271)
11+
Defined in: [index.ts:275](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L275)
1212

1313
getLatestGcloudSDKVersion fetches the latest version number from the API.
1414

docs/index/functions/installComponent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **installComponent**(`component`): `Promise`\<`void`\>
1010
11-
Defined in: [index.ts:255](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L255)
11+
Defined in: [index.ts:259](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L259)
1212

1313
Install a Cloud SDK component.
1414

docs/index/functions/installGcloudSDK.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Function: installGcloudSDK()
88

9-
> **installGcloudSDK**(`version`, `skipToolCache?`): `Promise`\<`string`\>
9+
> **installGcloudSDK**(`version`, `useToolCache`): `Promise`\<`string`\>
1010
1111
Defined in: [index.ts:168](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L168)
1212

@@ -22,9 +22,9 @@ The version or version specification to install. If a
2222
specification is given, the most recent version that still matches the
2323
specification is installed.
2424

25-
### skipToolCache?
25+
### useToolCache
2626

27-
`boolean`
27+
`boolean` = `false`
2828

2929
## Returns
3030

0 commit comments

Comments
 (0)