Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewslotin/go-proxy-pull-action
Pull the new release of a module to the Go proxy cache
https://github.com/andrewslotin/go-proxy-pull-action
documentation go go-modules golang hacktoberfest
Last synced: 8 days ago
JSON representation
Pull the new release of a module to the Go proxy cache
- Host: GitHub
- URL: https://github.com/andrewslotin/go-proxy-pull-action
- Owner: andrewslotin
- License: mit
- Created: 2020-05-25T14:44:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-17T11:41:52.000Z (5 months ago)
- Last Synced: 2024-10-27T13:28:16.960Z (12 days ago)
- Topics: documentation, go, go-modules, golang, hacktoberfest
- Language: Shell
- Homepage:
- Size: 11.7 KB
- Stars: 26
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actions - Pull the New Go Module Version Into the Proxy Cache - Ensures the latest version of your Go module is in the proxy cache. Also updates the pkg.go.dev documentation upon release. (Community Resources / Utility)
- fucking-awesome-actions - Pull the New Go Module Version Into the Proxy Cache - Ensures the latest version of your Go module is in the proxy cache. Also updates the pkg.go.dev documentation upon release. (Community Resources / Utility)
- awesome-workflows - Pull the New Go Module Version Into the Proxy Cache - Ensures the latest version of your Go module is in the proxy cache. Also updates the pkg.go.dev documentation upon release. (Community Resources / Utility)
README
Go proxy warming action
=======================This action ensures that a newly released version of a Go module is pulled to the specified proxy.
Each time there is a new tag created in repository with a name that looks like a [semantic version](https://blog.golang.org/publishing-go-modules), the action gets triggered, pulling this version with `go get` via the
configured proxy (https://proxy.golang.org by default).The action also recognizes the tags that version submodules stored within the same repository,
e.g. `contrib/awesomity/v1.2.3`.Usage
-----To renew the documentation on [pkg.go.dev](https://pkg.go.dev) create a new workflow file with following context:
```yaml
on:
release:
types:
- created
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- '**/v[0-9]+.[0-9]+.[0-9]+'jobs:
build:
name: Renew documentation
runs-on: ubuntu-latest
steps:
- name: Pull new module version
uses: andrewslotin/go-proxy-pull-action@master
```This will trigger the action each time whenever a new release is published for a tag that looks either like `vX.Y.Z` or
`submodule/path/vX.Y.Z`.### Custom proxy
The action accepts `gopath` parameter to specify the URL of a self-hosted or any other Go proxy instead of https://proxy.golang.org. For example to make sure that [GoCenter](https://gocenter.io) has the latest version of your module provide `https://gocenter.io` as a value for `goproxy` parameter:
```yaml
- name: Pull new module version
uses: andrewslotin/go-proxy-pull-action@master
with:
goproxy: https://gocenter.io
```### Custom import path
In case your module uses custom import path, such as `example.com/myproject`, an attempt to download it using its GitHub reporitory URL will result in an error. In this case you need to provide the import path of your package as an input:
```yaml
- name: Pull new module version
uses: andrewslotin/[email protected]
with:
import_path: example.com/myproject
```Why?
----Although the Go module proxies are capable of pulling the missing versions on-demand, there are cases when
this needs to be done before anyone has requested a new version via `go get` through this proxy. An example
would be updating the `pkg.go.dev` documentation of your library upon release.Currently the [pkg.go.dev](https://pkg.go.dev), unlike [godoc.org](https://godoc.org) does not track new
module versions, displaying the last one it knows about as the latest one. The proposed workaround
[suggests](https://github.com/golang/go/issues/37005#issuecomment-599541549) pulling the new version via
`go get` after it has been released, which is now automated with this GitHub action.License
-------The scripts and documentation in this project are released under the [MIT License](LICENSE).