mirror of
https://github.com/actions/setup-node.git
synced 2024-11-13 18:58:04 +00:00
Compare commits
6 Commits
2b66b44c0c
...
90896a2644
Author | SHA1 | Date | |
---|---|---|---|
|
90896a2644 | ||
|
97ca147735 | ||
|
aa363ded8f | ||
|
1c7b2db920 | ||
|
325751ad7d | ||
|
7d0203234e |
22
.github/workflows/publish-immutable-actions.yml
vendored
Normal file
22
.github/workflows/publish-immutable-actions.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: 'Publish Immutable Action Version'
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checking out
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Publish
|
||||||
|
id: publish
|
||||||
|
uses: actions/publish-immutable-action@0.0.1
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
10
dist/setup/index.js
vendored
10
dist/setup/index.js
vendored
@ -93883,7 +93883,7 @@ class BaseDistribution {
|
|||||||
}
|
}
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
const toolPath = yield this.extractArchive(downloadPath, info);
|
const toolPath = yield this.extractArchive(downloadPath, info, true);
|
||||||
core.info('Done');
|
core.info('Done');
|
||||||
return toolPath;
|
return toolPath;
|
||||||
});
|
});
|
||||||
@ -93933,7 +93933,7 @@ class BaseDistribution {
|
|||||||
return toolPath;
|
return toolPath;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
extractArchive(downloadPath, info) {
|
extractArchive(downloadPath, info, isOfficialArchive) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
//
|
//
|
||||||
// Extract
|
// Extract
|
||||||
@ -93948,7 +93948,7 @@ class BaseDistribution {
|
|||||||
// on Windows runners without PowerShell Core.
|
// on Windows runners without PowerShell Core.
|
||||||
//
|
//
|
||||||
// For default PowerShell Windows it should contain extension type to unpack it.
|
// For default PowerShell Windows it should contain extension type to unpack it.
|
||||||
if (extension === '.zip') {
|
if (extension === '.zip' && isOfficialArchive) {
|
||||||
const renamedArchive = `${downloadPath}.zip`;
|
const renamedArchive = `${downloadPath}.zip`;
|
||||||
fs_1.default.renameSync(downloadPath, renamedArchive);
|
fs_1.default.renameSync(downloadPath, renamedArchive);
|
||||||
extPath = yield tc.extractZip(renamedArchive);
|
extPath = yield tc.extractZip(renamedArchive);
|
||||||
@ -94186,7 +94186,7 @@ class OfficialBuilds extends base_distribution_1.default {
|
|||||||
core.info(`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`);
|
core.info(`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`);
|
||||||
downloadPath = yield tc.downloadTool(versionInfo.downloadUrl, undefined, this.nodeInfo.auth);
|
downloadPath = yield tc.downloadTool(versionInfo.downloadUrl, undefined, this.nodeInfo.auth);
|
||||||
if (downloadPath) {
|
if (downloadPath) {
|
||||||
toolPath = yield this.extractArchive(downloadPath, versionInfo);
|
toolPath = yield this.extractArchive(downloadPath, versionInfo, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -94433,7 +94433,6 @@ function run() {
|
|||||||
//
|
//
|
||||||
const version = resolveVersionInput();
|
const version = resolveVersionInput();
|
||||||
let arch = core.getInput('architecture');
|
let arch = core.getInput('architecture');
|
||||||
const cache = core.getInput('cache');
|
|
||||||
// if architecture supplied but node-version is not
|
// if architecture supplied but node-version is not
|
||||||
// if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant.
|
// if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant.
|
||||||
if (arch && !version) {
|
if (arch && !version) {
|
||||||
@ -94463,6 +94462,7 @@ function run() {
|
|||||||
if (registryUrl) {
|
if (registryUrl) {
|
||||||
auth.configAuthentication(registryUrl, alwaysAuth);
|
auth.configAuthentication(registryUrl, alwaysAuth);
|
||||||
}
|
}
|
||||||
|
const cache = core.getInput('cache');
|
||||||
if (cache && (0, cache_utils_1.isCacheFeatureAvailable)()) {
|
if (cache && (0, cache_utils_1.isCacheFeatureAvailable)()) {
|
||||||
core.saveState(constants_1.State.CachePackageManager, cache);
|
core.saveState(constants_1.State.CachePackageManager, cache);
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||||
|
8
package-lock.json
generated
8
package-lock.json
generated
@ -4429,12 +4429,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/micromatch": {
|
"node_modules/micromatch": {
|
||||||
"version": "4.0.5",
|
"version": "4.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
|
||||||
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
|
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"braces": "^3.0.2",
|
"braces": "^3.0.3",
|
||||||
"picomatch": "^2.3.1"
|
"picomatch": "^2.3.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
@ -150,7 +150,7 @@ export default abstract class BaseDistribution {
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
const toolPath = await this.extractArchive(downloadPath, info);
|
const toolPath = await this.extractArchive(downloadPath, info, true);
|
||||||
core.info('Done');
|
core.info('Done');
|
||||||
|
|
||||||
return toolPath;
|
return toolPath;
|
||||||
@ -210,7 +210,8 @@ export default abstract class BaseDistribution {
|
|||||||
|
|
||||||
protected async extractArchive(
|
protected async extractArchive(
|
||||||
downloadPath: string,
|
downloadPath: string,
|
||||||
info: INodeVersionInfo | null
|
info: INodeVersionInfo | null,
|
||||||
|
isOfficialArchive?: boolean
|
||||||
) {
|
) {
|
||||||
//
|
//
|
||||||
// Extract
|
// Extract
|
||||||
@ -225,7 +226,7 @@ export default abstract class BaseDistribution {
|
|||||||
// on Windows runners without PowerShell Core.
|
// on Windows runners without PowerShell Core.
|
||||||
//
|
//
|
||||||
// For default PowerShell Windows it should contain extension type to unpack it.
|
// For default PowerShell Windows it should contain extension type to unpack it.
|
||||||
if (extension === '.zip') {
|
if (extension === '.zip' && isOfficialArchive) {
|
||||||
const renamedArchive = `${downloadPath}.zip`;
|
const renamedArchive = `${downloadPath}.zip`;
|
||||||
fs.renameSync(downloadPath, renamedArchive);
|
fs.renameSync(downloadPath, renamedArchive);
|
||||||
extPath = await tc.extractZip(renamedArchive);
|
extPath = await tc.extractZip(renamedArchive);
|
||||||
|
@ -88,7 +88,11 @@ export default class OfficialBuilds extends BaseDistribution {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (downloadPath) {
|
if (downloadPath) {
|
||||||
toolPath = await this.extractArchive(downloadPath, versionInfo);
|
toolPath = await this.extractArchive(
|
||||||
|
downloadPath,
|
||||||
|
versionInfo,
|
||||||
|
false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
core.info(
|
core.info(
|
||||||
|
@ -19,7 +19,6 @@ export async function run() {
|
|||||||
const version = resolveVersionInput();
|
const version = resolveVersionInput();
|
||||||
|
|
||||||
let arch = core.getInput('architecture');
|
let arch = core.getInput('architecture');
|
||||||
const cache = core.getInput('cache');
|
|
||||||
|
|
||||||
// if architecture supplied but node-version is not
|
// if architecture supplied but node-version is not
|
||||||
// if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant.
|
// if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant.
|
||||||
@ -59,6 +58,7 @@ export async function run() {
|
|||||||
auth.configAuthentication(registryUrl, alwaysAuth);
|
auth.configAuthentication(registryUrl, alwaysAuth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cache = core.getInput('cache');
|
||||||
if (cache && isCacheFeatureAvailable()) {
|
if (cache && isCacheFeatureAvailable()) {
|
||||||
core.saveState(State.CachePackageManager, cache);
|
core.saveState(State.CachePackageManager, cache);
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||||
|
Loading…
Reference in New Issue
Block a user