From c2f2a65ee8ba0056209bde6635e608677d42ec52 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 31 May 2022 14:14:38 -0400 Subject: [PATCH 1/2] .github/workflows: Use new setup-go go-version-file input Reference: https://github.com/actions/setup-go/releases/tag/v3.1.0 --- .github/workflows/ci-github-actions.yml | 5 +---- .github/workflows/ci-go.yml | 18 +++--------------- .github/workflows/ci-goreleaser.yml | 5 +---- .github/workflows/ci-protobuf.yml | 5 +---- .github/workflows/release.yml | 5 +---- 5 files changed, 7 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci-github-actions.yml b/.github/workflows/ci-github-actions.yml index ba790468..0b6e2d3e 100644 --- a/.github/workflows/ci-github-actions.yml +++ b/.github/workflows/ci-github-actions.yml @@ -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 diff --git a/.github/workflows/ci-go.yml b/.github/workflows/ci-go.yml index 4fbbf024..0822ed16 100644 --- a/.github/workflows/ci-go.yml +++ b/.github/workflows/ci-go.yml @@ -6,7 +6,6 @@ on: paths: - .github/workflows/ci-go.yml - .golangci.yml - - .go-version - go.mod - '**.go' @@ -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: @@ -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 }} @@ -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 }} diff --git a/.github/workflows/ci-goreleaser.yml b/.github/workflows/ci-goreleaser.yml index 4d9e32e3..c47009a2 100644 --- a/.github/workflows/ci-goreleaser.yml +++ b/.github/workflows/ci-goreleaser.yml @@ -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 diff --git a/.github/workflows/ci-protobuf.yml b/.github/workflows/ci-protobuf.yml index f5aa956d..21ec5526 100644 --- a/.github/workflows/ci-protobuf.yml +++ b/.github/workflows/ci-protobuf.yml @@ -19,12 +19,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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25cf93e7..b245304f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 From ca401b5ab8fd389c20dfecff98c720eea68b0892 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 31 May 2022 14:26:54 -0400 Subject: [PATCH 2/2] Actually remove .go-version --- .github/workflows/ci-protobuf.yml | 1 - .go-version | 1 - 2 files changed, 2 deletions(-) delete mode 100644 .go-version diff --git a/.github/workflows/ci-protobuf.yml b/.github/workflows/ci-protobuf.yml index 21ec5526..225ddcba 100644 --- a/.github/workflows/ci-protobuf.yml +++ b/.github/workflows/ci-protobuf.yml @@ -5,7 +5,6 @@ on: pull_request: paths: - .github/workflows/ci-protobuf.yml - - .go-version - go.mod - go.sum - 'tfprotov5/internal/tfplugin5/*' diff --git a/.go-version b/.go-version deleted file mode 100644 index bf544f7b..00000000 --- a/.go-version +++ /dev/null @@ -1 +0,0 @@ -1.17.8 \ No newline at end of file