mirror of https://github.com/actions/setup-go
Compare commits
6 Commits
e07c5f5f0b
...
c86b535f9f
Author | SHA1 | Date |
---|---|---|
Masahiro Furudate | c86b535f9f | |
Masahiro Furudate | d55cd80f9a | |
Masahiro Furudate | b31a50ec78 | |
Masahiro Furudate | 6e0245c608 | |
Masahiro Furudate | cdcb360436 | |
Andy Brody | 99176a8f9a |
23
README.md
23
README.md
|
@ -8,6 +8,14 @@ This action sets up a go environment for use in actions by:
|
|||
- Optionally downloading and caching a version of Go by version and adding to `PATH`.
|
||||
- Registering problem matchers for error output.
|
||||
|
||||
# V5
|
||||
|
||||
The V5 edition of the action offers:
|
||||
|
||||
- Upgraded Node.js runtime from node16 to node20
|
||||
|
||||
See full release notes on the [releases page](https://github.com/actions/setup-go/releases).
|
||||
|
||||
# V4
|
||||
|
||||
The V4 edition of the action offers:
|
||||
|
@ -62,9 +70,10 @@ steps:
|
|||
>
|
||||
> ```yaml
|
||||
> go-version: '1.20'
|
||||
> ```
|
||||
> ```
|
||||
>
|
||||
> The recommendation is based on the YAML parser's behavior, which interprets non-wrapped values as numbers and, in the case of version 1.20, trims it down to 1.2, which may not be very obvious.
|
||||
|
||||
Matching an unstable pre-release:
|
||||
|
||||
```yaml
|
||||
|
@ -182,11 +191,13 @@ steps:
|
|||
|
||||
## Getting go version from the go.mod file
|
||||
|
||||
The `go-version-file` input accepts a path to a `go.mod` file or a `go.work` file that contains the version of Go to be
|
||||
used by a project. As the `go.mod` file contains only major and minor (e.g. 1.18) tags, the action will search for the
|
||||
latest available patch version sequentially in the runner's directory with the cached tools, in
|
||||
the [versions-manifest.json](https://github.com/actions/go-versions/blob/main/versions-manifest.json) file or at the go
|
||||
servers.
|
||||
The `go-version-file` input accepts a path to a `go.mod` file or a `go.work` file that contains the version of Go to be used by a project.
|
||||
|
||||
The `go` directive in `go.mod` can specify a patch version or omit it altogether (e.g., `go 1.22.0` or `go 1.22`).
|
||||
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,
|
||||
[versions-manifest.json](https://github.com/actions/go-versions/blob/main/versions-manifest.json), and the
|
||||
[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.
|
||||
> The action will search for the `go.mod` file relative to the repository root
|
||||
|
|
|
@ -88039,6 +88039,7 @@ const sys = __importStar(__nccwpck_require__(5632));
|
|||
const fs_1 = __importDefault(__nccwpck_require__(7147));
|
||||
const os_1 = __importDefault(__nccwpck_require__(2037));
|
||||
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) {
|
||||
return __awaiter(this, arguments, void 0, function* (versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
|
||||
var _a;
|
||||
|
@ -88258,8 +88259,7 @@ function findMatch(versionSpec_1) {
|
|||
const platFilter = sys.getPlatform();
|
||||
let result;
|
||||
let match;
|
||||
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
|
||||
const candidates = yield module.exports.getVersionsDist(dlUrl);
|
||||
const candidates = yield module.exports.getVersionsDist(GOLANG_DOWNLOAD_URL);
|
||||
if (!candidates) {
|
||||
throw new Error(`golang download url did not return results`);
|
||||
}
|
||||
|
@ -88339,8 +88339,7 @@ function resolveStableVersionDist(versionSpec, arch) {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const archFilter = sys.getArch(arch);
|
||||
const platFilter = sys.getPlatform();
|
||||
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
|
||||
const candidates = yield module.exports.getVersionsDist(dlUrl);
|
||||
const candidates = yield module.exports.getVersionsDist(GOLANG_DOWNLOAD_URL);
|
||||
if (!candidates) {
|
||||
throw new Error(`golang download url did not return results`);
|
||||
}
|
||||
|
|
|
@ -6,13 +6,13 @@ We have prepared a short guide so that the process of making your contribution i
|
|||
|
||||
## How can I contribute...
|
||||
|
||||
* [Contribute Documentation:green_book:](#contribute-documentation)
|
||||
* [Contribute Documentation :green_book:](#contribute-documentation)
|
||||
|
||||
* [Contribute Code :computer:](#contribute-code)
|
||||
|
||||
* [Provide Support on Issues:pencil:](#provide-support-on-issues)
|
||||
* [Provide Support on Issues :pencil:](#provide-support-on-issues)
|
||||
|
||||
* [Review Pull Requests:mag:](#review-pull-requests)
|
||||
* [Review Pull Requests :mag:](#review-pull-requests)
|
||||
|
||||
## Contribute documentation
|
||||
|
||||
|
@ -113,4 +113,4 @@ Another great way to contribute is pull request reviews. Please, be extra kind:
|
|||
- Make sure you're familiar with the code or documentation is updated, unless it's a minor change (spellchecking, minor formatting, etc.)
|
||||
- Review changes using the GitHub functionality. You can ask a clarifying question, point out an error or suggest an alternative.
|
||||
> Note: You may ask for minor changes - "nitpicks", but consider whether they are real blockers to merging or not
|
||||
- Submit your review, which may include comments, an approval, or a changes request
|
||||
- Submit your review, which may include comments, an approval, or a changes request
|
||||
|
|
|
@ -10,6 +10,8 @@ import {StableReleaseAlias} from './utils';
|
|||
|
||||
type InstallationType = 'dist' | 'manifest';
|
||||
|
||||
const GOLANG_DOWNLOAD_URL = 'https://go.dev/dl/?mode=json&include=all';
|
||||
|
||||
export interface IGoVersionFile {
|
||||
filename: string;
|
||||
// darwin, linux, windows
|
||||
|
@ -335,9 +337,8 @@ export async function findMatch(
|
|||
let result: IGoVersion | undefined;
|
||||
let match: IGoVersion | undefined;
|
||||
|
||||
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
|
||||
const candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
|
||||
dlUrl
|
||||
GOLANG_DOWNLOAD_URL
|
||||
);
|
||||
if (!candidates) {
|
||||
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) {
|
||||
const archFilter = sys.getArch(arch);
|
||||
const platFilter = sys.getPlatform();
|
||||
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
|
||||
const candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
|
||||
dlUrl
|
||||
GOLANG_DOWNLOAD_URL
|
||||
);
|
||||
if (!candidates) {
|
||||
throw new Error(`golang download url did not return results`);
|
||||
|
|
Loading…
Reference in New Issue