Skip to content

Commit

Permalink
Bump actions/setup-go@v5 / actions/cache@v4
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetikonline committed Mar 7, 2024
1 parent ec2faaf commit fcca93e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Reduce all these workflow steps:
```yaml
steps:
- name: Setup Golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ~1.20
- name: Setup Golang caches
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
Expand All @@ -34,17 +34,17 @@ down to this:
```yaml
steps:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
uses: magnetikonline/action-golang-cache@v5
with:
go-version: ~1.20
go-version: ~1.22
```
or better yet, use `go-version-file` for version selection:

```yaml
steps:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
uses: magnetikonline/action-golang-cache@v5
with:
go-version-file: go.mod
```
Expand All @@ -58,9 +58,9 @@ An optional `cache-key-suffix` input allows control of the generated cache key.
```yaml
steps:
- name: Cache key suffix
uses: magnetikonline/action-golang-cache@v4
uses: magnetikonline/action-golang-cache@v5
with:
go-version: ~1.20
go-version: ~1.22
cache-key-suffix: apples
# cache key: ${{ runner.os }}-golang-apples-${{ hashFiles('**/go.sum') }}
Expand All @@ -75,15 +75,15 @@ Outputs of `build-cache-path`, `module-cache-path` and `cache-key` are provided
steps:
- name: Setup Golang with cache
id: golang-with-cache
uses: magnetikonline/action-golang-cache@v4
uses: magnetikonline/action-golang-cache@v5
with:
go-version-file: go.mod
# further steps...
- name: Save Golang cache
if: always()
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: |
${{ steps.golang-with-cache.outputs.build-cache-path }}
Expand Down
4 changes: 2 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:
using: composite
steps:
- name: Setup Golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
cache: false
go-version: ${{ inputs.go-version }}
Expand All @@ -43,7 +43,7 @@ runs:
echo "cache-key=${cacheKeyRoot}${{ hashFiles('**/go.sum') }}" >>"$GITHUB_OUTPUT"
shell: bash
- name: Setup Golang cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ steps.golang-env.outputs.build-cache-path }}
Expand Down

0 comments on commit fcca93e

Please sign in to comment.