Commit Graph

64 Commits (8f19afcc704763637be6b1718da0af52ca05785d)

Author SHA1 Message Date
George Adams 8f19afcc70
feat: add go-download-base-url input for custom Go distributions (#721)
* feat: add go-download-base-url input for custom Go distributions

Add support for downloading Go from custom sources such as Microsoft Go
(aka.ms). Users can specify a custom download base URL via the
`go-download-base-url` input or the `GO_DOWNLOAD_BASE_URL` environment
variable (input takes precedence).

When a custom URL is provided, the action skips the GitHub-hosted
manifest and attempts to resolve versions from the custom URL's JSON
listing. If the listing is unavailable (as with aka.ms redirect links),
it falls back to constructing the download URL directly from the
version, platform, and architecture.

Usage:
  - uses: actions/setup-go@v6
    with:
      go-version: '1.25'
      go-download-base-url: 'https://aka.ms/golang/release/latest'

Changes:
- action.yml: add go-download-base-url optional input
- installer.ts: add getInfoFromDirectDownload() for URL construction
  fallback, thread custom URL through getGo/getInfoFromDist/findMatch
- main.ts: read new input and GO_DOWNLOAD_BASE_URL env var
- setup-go.test.ts: add 12 unit tests for custom URL behavior
- microsoft-validation.yml: add E2E workflow testing Microsoft build of Go
  across ubuntu/windows/macos with versions 1.24 and 1.25
- README.md: document new input with Microsoft build of Go examples

* run prettier

* fixup PR review

* revert cache-save

* fixup

* handle distinct cache

* skip json for known URL

* fix bug in JSON with custom URL
1 week ago
Priya Gupta def8c394e3
Rearrange README.md, add advanced-usage.md (#724)
* Rearrange README.md, add advanced-usage.md

* Fix YAML indentation in examples

* Fix YAML indentation in Advanced Usage workflow examples
4 weeks ago
Priya Gupta a5f9b05d2d
Update default Go module caching to use go.mod (#705)
* Update module cache to use go.mod as key

* Fix typo

* Revise breaking changes in README for V6

Updated breaking changes section with enhanced formatting and clarified toolchain management details.
2 months ago
Andreas Deininger d73f6bcfc2
README.md: correct to actions/checkout@v6 (#683) 2 months ago
aparnajyothi-y 4aaadf4266
Example for restore-only cache in documentation (#696)
* cache-restore-only example

* resolve conflicts

* example update

* format update

* format update

* update
3 months ago
dependabot[bot] 4dc6199c7b
Bump semver and @types/semver (#652)
* Bump semver and @types/semver

Bumps [semver](https://github.com/npm/node-semver) and [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver). These dependencies needed to be updated together.

Updates `semver` from 7.7.1 to 7.7.2
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.7.1...v7.7.2)

Updates `@types/semver` from 7.5.8 to 7.7.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver)

---
updated-dependencies:
- dependency-name: semver
  dependency-version: 7.7.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: "@types/semver"
  dependency-version: 7.7.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: add license information for semver dependency

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: HarithaVattikuti <73516759+HarithaVattikuti@users.noreply.github.com>
4 months ago
mahabaleshwars f3787be646
Add comprehensive breaking changes documentation for v6 (#674)
* v6 documentation update

* v6 documentation update

* Readme file update

* update documentation

* documentation update

* update documentation

* Updated documentation

* Updated Documentation

* documentation update

* update documentation. action.yml and versions.yml

* Update documentation to organize go-version-file

* update v6 features and improve version patterns table

* Update documentation to specify supported syntaxes for `go-version` input
4 months ago
priya-kinthali faf52423ec
Add support for .tool-versions file in setup-go, update workflow (#673)
* setup go in local

* add .tool-versions file support
5 months ago
Nicholas Ngai 7bc60db215
Fall back to downloading from go.dev/dl instead of storage.googleapis.com/golang (#665)
* Fall back to downloading from dl.google.com/go instead of storage.googleapis.com/golang

* Use go.dev/dl instead
5 months ago
dependabot[bot] c0137caad7
Bump eslint-config-prettier from 10.0.1 to 10.1.8 and document breaking changes in v6 (#617)
* Bump eslint-config-prettier from 10.0.1 to 10.1.8

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-version: 10.1.8
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* doc update

* doc update

* update

* doc update

* doc update

* doc update

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com>
6 months ago
Salman Chishti e093d1e9bb
Node 24 upgrade (#624)
* Node 24 upgrade

Doing an upgrade for node 24, node 24 is stricter with types so need to add a type for achitecture

* format

* package updates

* fix for check failures

* upgrade @types/node

* update package.json version

* check failure fix

* package-lock.json update

* update node24

* npm run format

* npm run format

* node update from the workflows

* Upgrade `actions/checkout` to v5 and `actions/setup-go` to v6 in README.md

---------

Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com>
Co-authored-by: Priya Gupta <147705955+priyagupta108@users.noreply.github.com>
7 months ago
Matthew Hughes 1d76b952eb
Improve toolchain handling (#460)
* Configure environment to avoid toolchain installs

Force `go` to always use the local toolchain (i.e. the one the one that
shipped with the go command being run) via setting the `GOTOOLCHAIN`
environment variable to `local`[1]:

> When GOTOOLCHAIN is set to local, the go command always runs the
bundled Go toolchain.

This is how things are setup in the official Docker images (e.g.[2], see
also the discussion around that change[3]). The motivation behind this
is to:

* Reduce duplicate work: if the `toolchain` version in `go.mod` was
  greated than the `go` version, the version from the `go` directive
  would be installed, then Go would detect the `toolchain` version and
  additionally install that
* Avoid Unexpected behaviour: if you specify this action runs with some Go
  version (e.g. `1.21.0`) but your go.mod contains a `toolchain` or `go`
  directive for a newer version (e.g. `1.22.0`) then, without any other
  configuration/environment setup, any go commands will be run using go
  `1.22.0`

This will be a **breaking change** for some workflows. Given a `go.mod`
like:

    module proj

    go 1.22.0

Then running any `go` command, e.g. `go mod tidy`, in an environment
where only go versions before `1.22.0` were installed would previously
trigger a toolchain download of Go `1.22.0` and that version being used
to execute the command. With this change the above would error out with
something like:

> go: go.mod requires go >= 1.22.0 (running go 1.21.7;
GOTOOLCHAIN=local)

[1] https://go.dev/doc/toolchain#select
[2] dae3405a32/Dockerfile-linux.template (L163)
[3] https://github.com/docker-library/golang/issues/472

* Prefer installing version from `toolchain` directive

Prefer this over the version from the `go` directive. Per the docs[1]

> The toolchain line declares a suggested toolchain to use with the
module or workspace

It seems reasonable to use this, since running this action in a
directory containing a `go.mod` (or `go.work`) suggests the user is
wishing to work _with the module or workspace_.

Link: https://go.dev/doc/toolchain#config [1]
Issue: https://github.com/actions/setup-go/issues/457

* squash! Configure environment to avoid toolchain installs

Only modify env if `GOTOOLCHAIN` is not set

* squash! Prefer installing version from `toolchain` directive

Avoid installing from `toolchain` if `GOTOOLCHAIN` is `local`, also
better regex for matching toolchain directive
7 months ago
HarithaVattikuti 3d10edb4c2
Add new permission section (#533) 1 year ago
Tobias 3041bf56c9
feat: fallback to "raw" endpoint for manifest when rate limit is reached (#496)
* feat: fallback to "raw" endpoint for manifest when rate limit is reached

* add information about raw access to the README

* prettier

* update cross-spawn to 7.0.6 to fix vulnerability
1 year ago
Masahiro Furudate cdcb360436
Remove the description of the old go.mod specification (#458)
* Fix emoji rendering

* Fix quoting

* Remove the description of the old go.mod specification

* Remove the single quotes from `go-version-file`

* Fix README

* Add description about patch versions to README

* Revert "Remove the single quotes from `go-version-file`"

This reverts commit ca4321abee.
2 years ago
Andy Brody 99176a8f9a
Update README.md with V5 release notes (#459) 2 years ago
Rui Chen 6c1fd22b67
docs: bump `actions/setup-go` to v5 (#449)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2 years ago
Rui Chen 3d65fa57fc
feat: bump to use actions/checkout@v4
Signed-off-by: Rui Chen <rui@chenrui.dev>
3 years ago
Artem Gavrilov d45ebba0ce
Rephrase sentence
Co-authored-by: Ivan <98037481+IvanZosimov@users.noreply.github.com>
3 years ago
Artem Gavrilov 317c6617fa
Replace `wildcards` term with `globs`. 3 years ago
Artem Gavrilov 8018234347
Improve documentation regarding dependencies cachin 3 years ago
Dmitry Shibanov 992f068900
Add note about YAML parsing versions (#382) 3 years ago
yukyan 0e6baa5a93
Added a description that go-version should be specified as a string type (#367) 3 years ago
Sergey Dolin 8dbf352f06
update README fo v4 (#354) 3 years ago
Sergey Dolin c51a720768
Enable caching by default with default input (#332) 3 years ago
Serghei Iakovlev 807559307d
Use const declarations for variables that are never reassigned (#322) 3 years ago
Seonghyeon Cho 9c64203f1d
Update basic validation badge 3 years ago
Milos Pantic 38dbe75f81
Add stable and oldstable aliases (#300) 3 years ago
Marko Zivic e983b65a44
Merge pull request #283 from koba1t/add_support_gowork_for_go-version-file
add support go.work file for go-version-file
3 years ago
Dmitry Shibanov 27b43e1b0d
Pass the token input through on GHES (#277) 3 years ago
koba1t 7678c83214
add support gowork for go-version-file 3 years ago
Aleksey Zhukov e68a999c97
Fix broken `code of conduct` link (#260) 4 years ago
IvanZosimov b22fbbc292
Implementation of caching functionality for setup-go action (#228) 4 years ago
So Jomura 265edc1beb
Add go-version-file option (#62) 4 years ago
Vladimir Safonkin 3332358454 Add note about go building 4 years ago
Peter Mescalchin bf7ccf173e
Correct some small `README.md` formatting typos (#213) 4 years ago
Peter Mescalchin dcb4ec94ce
Bump GitHub actions, `README.md` cleanups (#202)
* Bump `actions/checkout@v3`

* Bump `actions/setup-node@v3`

* Bump `actions/upload-artifact@v3`

* Bump `actions/setup-go@v3` in `README.md` examples

* Removed mention of `stable` action argument from `README.md`

* Add "new style" workflow build buttons to `README.md`
4 years ago
Vladimir Safonkin 341b20ac36
Update usage examples on readme (#212)
* Fix action usage examples on readme

* Revert changes on package-lock

* Fix some checkout action version
4 years ago
Vladimir Safonkin acdbc5377c Remove stable input description from README 4 years ago
Vladimir Safonkin 3e6475c089 Update README to v3 4 years ago
Dmitry Shibanov bfdd3570ce
Implement "check-latest" flag to check if pre-cached version is latest one (#186) 4 years ago
Sergey Gaynetdinov 44e221478f
Replace 'ubuntu-16.04' -> 'ubuntu-latest' (#180) 4 years ago
Sergey-Murtazin 3e9d5483e6
Add semver note to documentation (#164) 4 years ago
Masahiro Furudate 02f7ea9f09
Fix yaml indent (#59) 4 years ago
Linus Gasser 6eb700292f
Reference latest setup-go 5 years ago
Bryan MacFarlane 8e98458ff1 updating matrix in readme 6 years ago
Maxim Lobanov d0c5defdf3
Switch manifest installation from "master" to "main" branch (#65)
* switch from master to main branch

* Update README.md
6 years ago
Bryan MacFarlane 0f551ac199
Update v2 tags in readme 6 years ago
Bryan MacFarlane e1c0a1665b
Update readme with v2 release 6 years ago
Bryan MacFarlane 768458bd0b pre-release version and test 6 years ago