mirror of
https://github.com/actions/setup-go.git
synced 2026-02-28 10:14:46 +08:00
Compare commits
1 Commits
93e30a148d
...
v5.4.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0aaccfd150 |
2
.licenses/npm/undici.dep.yml
generated
2
.licenses/npm/undici.dep.yml
generated
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: undici
|
||||
version: 5.28.4
|
||||
version: 5.28.5
|
||||
type: npm
|
||||
summary: An HTTP/1.1 client, written from scratch for Node.js
|
||||
homepage: https://undici.nodejs.org
|
||||
|
||||
@@ -8,7 +8,6 @@ import path from 'path';
|
||||
import * as main from '../src/main';
|
||||
import * as im from '../src/installer';
|
||||
import * as httpm from '@actions/http-client';
|
||||
import {getArch} from '../src/system';
|
||||
|
||||
import goJsonData from './data/golang-dl.json';
|
||||
import matchers from '../matchers.json';
|
||||
@@ -33,7 +32,6 @@ describe('setup-go', () => {
|
||||
let getSpy: jest.SpyInstance;
|
||||
let platSpy: jest.SpyInstance;
|
||||
let archSpy: jest.SpyInstance;
|
||||
let endianSpy: jest.SpyInstance;
|
||||
let joinSpy: jest.SpyInstance;
|
||||
let dlSpy: jest.SpyInstance;
|
||||
let extractTarSpy: jest.SpyInstance;
|
||||
@@ -73,8 +71,6 @@ describe('setup-go', () => {
|
||||
archSpy = jest.spyOn(osm, 'arch');
|
||||
archSpy.mockImplementation(() => os['arch']);
|
||||
execSpy = jest.spyOn(cp, 'execSync');
|
||||
endianSpy = jest.spyOn(osm, 'endianness');
|
||||
endianSpy.mockImplementation(() => os['endianness']);
|
||||
|
||||
// switch path join behaviour based on set os.platform
|
||||
joinSpy = jest.spyOn(path, 'join');
|
||||
@@ -992,17 +988,5 @@ use .
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
it('should return ppc64 when architecture is ppc64 and system is Big Endian', () => {
|
||||
endianSpy.mockReturnValue('BE');
|
||||
const result = getArch('ppc64');
|
||||
expect(result).toBe('ppc64');
|
||||
});
|
||||
|
||||
it('should return ppc64le when architecture is ppc64 and system is Little Endian', () => {
|
||||
endianSpy.mockReturnValue('LE');
|
||||
const result = getArch('ppc64');
|
||||
expect(result).toBe('ppc64le');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
18
dist/cache-save/index.js
vendored
18
dist/cache-save/index.js
vendored
@@ -65451,6 +65451,14 @@ const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
|
||||
const { File: UndiciFile } = __nccwpck_require__(8511)
|
||||
const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
|
||||
|
||||
let random
|
||||
try {
|
||||
const crypto = __nccwpck_require__(6005)
|
||||
random = (max) => crypto.randomInt(0, max)
|
||||
} catch {
|
||||
random = (max) => Math.floor(Math.random(max))
|
||||
}
|
||||
|
||||
let ReadableStream = globalThis.ReadableStream
|
||||
|
||||
/** @type {globalThis['File']} */
|
||||
@@ -65536,7 +65544,7 @@ function extractBody (object, keepalive = false) {
|
||||
// Set source to a copy of the bytes held by object.
|
||||
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
|
||||
} else if (util.isFormDataLike(object)) {
|
||||
const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
|
||||
const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
|
||||
const prefix = `--${boundary}\r\nContent-Disposition: form-data`
|
||||
|
||||
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
||||
@@ -86891,6 +86899,14 @@ module.exports = require("net");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6005:
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("node:crypto");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5673:
|
||||
/***/ ((module) => {
|
||||
|
||||
|
||||
34
dist/setup/index.js
vendored
34
dist/setup/index.js
vendored
@@ -71739,6 +71739,14 @@ const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
|
||||
const { File: UndiciFile } = __nccwpck_require__(8511)
|
||||
const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
|
||||
|
||||
let random
|
||||
try {
|
||||
const crypto = __nccwpck_require__(6005)
|
||||
random = (max) => crypto.randomInt(0, max)
|
||||
} catch {
|
||||
random = (max) => Math.floor(Math.random(max))
|
||||
}
|
||||
|
||||
let ReadableStream = globalThis.ReadableStream
|
||||
|
||||
/** @type {globalThis['File']} */
|
||||
@@ -71824,7 +71832,7 @@ function extractBody (object, keepalive = false) {
|
||||
// Set source to a copy of the bytes held by object.
|
||||
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
|
||||
} else if (util.isFormDataLike(object)) {
|
||||
const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
|
||||
const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
|
||||
const prefix = `--${boundary}\r\nContent-Disposition: form-data`
|
||||
|
||||
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
||||
@@ -93741,23 +93749,15 @@ function getPlatform() {
|
||||
exports.getPlatform = getPlatform;
|
||||
function getArch(arch) {
|
||||
// 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', 'x32', and 'x64'.
|
||||
// wants amd64, 386, arm64, armv6l, ppc64le, s390x
|
||||
// wants amd64, 386, arm64, armv61, ppc641e, s390x
|
||||
// currently not supported by runner but future proofed mapping
|
||||
switch (arch) {
|
||||
case 'x64':
|
||||
arch = 'amd64';
|
||||
break;
|
||||
// In case of ppc64, further distinction is needed to determine the endianness
|
||||
// of the host as it can either be ppc64(Big Endian) or ppc64le (Little Endian) to download
|
||||
// the correct bundle.
|
||||
case 'ppc64':
|
||||
if (os_1.default.endianness() === 'LE') {
|
||||
arch = 'ppc64le';
|
||||
}
|
||||
else {
|
||||
arch = 'ppc64';
|
||||
}
|
||||
break;
|
||||
// case 'ppc':
|
||||
// arch = 'ppc64';
|
||||
// break;
|
||||
case 'x32':
|
||||
arch = '386';
|
||||
break;
|
||||
@@ -93900,6 +93900,14 @@ module.exports = require("net");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6005:
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("node:crypto");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5673:
|
||||
/***/ ((module) => {
|
||||
|
||||
|
||||
7
package-lock.json
generated
7
package-lock.json
generated
@@ -5793,9 +5793,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "5.28.4",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz",
|
||||
"integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==",
|
||||
"version": "5.28.5",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz",
|
||||
"integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@fastify/busboy": "^2.0.0"
|
||||
},
|
||||
|
||||
@@ -18,22 +18,15 @@ export function getPlatform(): string {
|
||||
export function getArch(arch: string): string {
|
||||
// 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', 'x32', and 'x64'.
|
||||
|
||||
// wants amd64, 386, arm64, armv6l, ppc64le, s390x
|
||||
// wants amd64, 386, arm64, armv61, ppc641e, s390x
|
||||
// currently not supported by runner but future proofed mapping
|
||||
switch (arch) {
|
||||
case 'x64':
|
||||
arch = 'amd64';
|
||||
break;
|
||||
// In case of ppc64, further distinction is needed to determine the endianness
|
||||
// of the host as it can either be ppc64(Big Endian) or ppc64le (Little Endian) to download
|
||||
// the correct bundle.
|
||||
case 'ppc64':
|
||||
if (os.endianness() === 'LE') {
|
||||
arch = 'ppc64le';
|
||||
} else {
|
||||
arch = 'ppc64';
|
||||
}
|
||||
break;
|
||||
// case 'ppc':
|
||||
// arch = 'ppc64';
|
||||
// break;
|
||||
case 'x32':
|
||||
arch = '386';
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user