Skip to content

Commit

Permalink
.github/workflows: Use new setup-go go-version-file input (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
bflad committed May 31, 2022
1 parent 21e3000 commit 7380ed5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 33 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci-github-actions.yml
Expand Up @@ -14,11 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: go-version
# Reference: https://github.com/actions/setup-go/issues/23
run: echo "::set-output name=version::$(cat ./.go-version)"
- uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.version }}
go-version-file: 'go.mod'
- run: go install github.com/rhysd/actionlint/cmd/actionlint@latest
- run: actionlint
18 changes: 3 additions & 15 deletions .github/workflows/ci-go.yml
Expand Up @@ -6,7 +6,6 @@ on:
paths:
- .github/workflows/ci-go.yml
- .golangci.yml
- .go-version
- go.mod
- '**.go'

Expand All @@ -18,12 +17,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: go-version
# Reference: https://github.com/actions/setup-go/issues/23
run: echo "::set-output name=version::$(cat ./.go-version)"
- uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.version }}
go-version-file: 'go.mod'
- run: go mod download
- uses: golangci/golangci-lint-action@v3.2.0
terraform-provider-corner-tfprotov5:
Expand All @@ -38,13 +34,9 @@ jobs:
with:
path: terraform-provider-corner
repository: hashicorp/terraform-provider-corner
- id: go-version
# Reference: https://github.com/actions/setup-go/issues/23
run: echo "::set-output name=version::$(cat ./.go-version)"
working-directory: .
- uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.version }}
go-version-file: 'go.mod'
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.terraform }}
Expand Down Expand Up @@ -80,13 +72,9 @@ jobs:
with:
path: terraform-provider-corner
repository: hashicorp/terraform-provider-corner
- id: go-version
# Reference: https://github.com/actions/setup-go/issues/23
run: echo "::set-output name=version::$(cat ./.go-version)"
working-directory: .
- uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.version }}
go-version-file: 'go.mod'
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.terraform }}
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/ci-goreleaser.yml
Expand Up @@ -14,12 +14,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: go-version
# Reference: https://github.com/actions/setup-go/issues/23
run: echo "::set-output name=version::$(cat ./.go-version)"
- uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.version }}
go-version-file: 'go.mod'
- uses: goreleaser/goreleaser-action@v3
with:
args: check
6 changes: 1 addition & 5 deletions .github/workflows/ci-protobuf.yml
Expand Up @@ -5,7 +5,6 @@ on:
pull_request:
paths:
- .github/workflows/ci-protobuf.yml
- .go-version
- go.mod
- go.sum
- 'tfprotov5/internal/tfplugin5/*'
Expand All @@ -19,12 +18,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: go-version
# Reference: https://github.com/actions/setup-go/issues/23
run: echo "::set-output name=version::$(cat ./.go-version)"
- uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.version }}
go-version-file: 'go.mod'
- uses: arduino/setup-protoc@v1
with:
# The version string is embedded in protoc generated files, so it is
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Expand Up @@ -19,12 +19,9 @@ jobs:
with:
# Required for release notes
fetch-depth: 0
- id: go-version
# Reference: https://github.com/actions/setup-go/issues/23
run: echo "::set-output name=version::$(cat ./.go-version)"
- uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.version }}
go-version-file: 'go.mod'
- name: Generate Release Notes
# Fetch CHANGELOG.md contents up to Git tag prior to this release, skipping top two lines
run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > /tmp/release-notes.txt
Expand Down
1 change: 0 additions & 1 deletion .go-version

This file was deleted.

0 comments on commit 7380ed5

Please sign in to comment.