mirror of
https://github.com/actions/setup-go.git
synced 2025-04-23 17:40:50 +00:00
Merge 461d38122d
into 41dfa10bad
This commit is contained in:
commit
36cf82eae4
3 changed files with 8 additions and 9 deletions
|
@ -197,7 +197,7 @@ The `go` directive in `go.mod` can specify a patch version or omit it altogether
|
||||||
If a patch version is specified, that specific patch version will be used.
|
If a patch version is specified, that specific patch version will be used.
|
||||||
If no patch version is specified, it will search for the latest available patch version in the cache,
|
If no patch version is specified, it will search for the latest available patch version in the cache,
|
||||||
[versions-manifest.json](https://github.com/actions/go-versions/blob/main/versions-manifest.json), and the
|
[versions-manifest.json](https://github.com/actions/go-versions/blob/main/versions-manifest.json), and the
|
||||||
[official Go language website](https://golang.org/dl/?mode=json&include=all), in that order.
|
[official Go language website](https://go.dev/dl/?mode=json&include=all), in that order.
|
||||||
|
|
||||||
If both the `go-version` and the `go-version-file` inputs are provided then the `go-version` input is used.
|
If both the `go-version` and the `go-version-file` inputs are provided then the `go-version` input is used.
|
||||||
> The action will search for the `go.mod` file relative to the repository root
|
> The action will search for the `go.mod` file relative to the repository root
|
||||||
|
|
7
dist/setup/index.js
vendored
7
dist/setup/index.js
vendored
|
@ -88259,6 +88259,7 @@ const sys = __importStar(__nccwpck_require__(5632));
|
||||||
const fs_1 = __importDefault(__nccwpck_require__(7147));
|
const fs_1 = __importDefault(__nccwpck_require__(7147));
|
||||||
const os_1 = __importDefault(__nccwpck_require__(2037));
|
const os_1 = __importDefault(__nccwpck_require__(2037));
|
||||||
const utils_1 = __nccwpck_require__(1314);
|
const utils_1 = __nccwpck_require__(1314);
|
||||||
|
const GOLANG_DOWNLOAD_URL = 'https://go.dev/dl/?mode=json&include=all';
|
||||||
function getGo(versionSpec_1, checkLatest_1, auth_1) {
|
function getGo(versionSpec_1, checkLatest_1, auth_1) {
|
||||||
return __awaiter(this, arguments, void 0, function* (versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
|
return __awaiter(this, arguments, void 0, function* (versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
|
||||||
var _a;
|
var _a;
|
||||||
|
@ -88478,8 +88479,7 @@ function findMatch(versionSpec_1) {
|
||||||
const platFilter = sys.getPlatform();
|
const platFilter = sys.getPlatform();
|
||||||
let result;
|
let result;
|
||||||
let match;
|
let match;
|
||||||
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
|
const candidates = yield module.exports.getVersionsDist(GOLANG_DOWNLOAD_URL);
|
||||||
const candidates = yield module.exports.getVersionsDist(dlUrl);
|
|
||||||
if (!candidates) {
|
if (!candidates) {
|
||||||
throw new Error(`golang download url did not return results`);
|
throw new Error(`golang download url did not return results`);
|
||||||
}
|
}
|
||||||
|
@ -88559,8 +88559,7 @@ function resolveStableVersionDist(versionSpec, arch) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const archFilter = sys.getArch(arch);
|
const archFilter = sys.getArch(arch);
|
||||||
const platFilter = sys.getPlatform();
|
const platFilter = sys.getPlatform();
|
||||||
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
|
const candidates = yield module.exports.getVersionsDist(GOLANG_DOWNLOAD_URL);
|
||||||
const candidates = yield module.exports.getVersionsDist(dlUrl);
|
|
||||||
if (!candidates) {
|
if (!candidates) {
|
||||||
throw new Error(`golang download url did not return results`);
|
throw new Error(`golang download url did not return results`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@ import {StableReleaseAlias} from './utils';
|
||||||
|
|
||||||
type InstallationType = 'dist' | 'manifest';
|
type InstallationType = 'dist' | 'manifest';
|
||||||
|
|
||||||
|
const GOLANG_DOWNLOAD_URL = 'https://go.dev/dl/?mode=json&include=all';
|
||||||
|
|
||||||
export interface IGoVersionFile {
|
export interface IGoVersionFile {
|
||||||
filename: string;
|
filename: string;
|
||||||
// darwin, linux, windows
|
// darwin, linux, windows
|
||||||
|
@ -335,9 +337,8 @@ export async function findMatch(
|
||||||
let result: IGoVersion | undefined;
|
let result: IGoVersion | undefined;
|
||||||
let match: IGoVersion | undefined;
|
let match: IGoVersion | undefined;
|
||||||
|
|
||||||
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
|
|
||||||
const candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
|
const candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
|
||||||
dlUrl
|
GOLANG_DOWNLOAD_URL
|
||||||
);
|
);
|
||||||
if (!candidates) {
|
if (!candidates) {
|
||||||
throw new Error(`golang download url did not return results`);
|
throw new Error(`golang download url did not return results`);
|
||||||
|
@ -434,9 +435,8 @@ export function parseGoVersionFile(versionFilePath: string): string {
|
||||||
async function resolveStableVersionDist(versionSpec: string, arch: string) {
|
async function resolveStableVersionDist(versionSpec: string, arch: string) {
|
||||||
const archFilter = sys.getArch(arch);
|
const archFilter = sys.getArch(arch);
|
||||||
const platFilter = sys.getPlatform();
|
const platFilter = sys.getPlatform();
|
||||||
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
|
|
||||||
const candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
|
const candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
|
||||||
dlUrl
|
GOLANG_DOWNLOAD_URL
|
||||||
);
|
);
|
||||||
if (!candidates) {
|
if (!candidates) {
|
||||||
throw new Error(`golang download url did not return results`);
|
throw new Error(`golang download url did not return results`);
|
||||||
|
|
Loading…
Add table
Reference in a new issue