From 02345913fb7711907bf34778184ea293cc6fd539 Mon Sep 17 00:00:00 2001 From: jojo43 Date: Sat, 4 Jul 2020 20:28:15 +0900 Subject: [PATCH 1/2] Read go version from .go-version --- .github/workflows/ci.yml | 20 ++++++++++++++++---- .github/workflows/release.yml | 10 ++++++++-- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 052f0a697..1bce9246c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,11 +18,17 @@ jobs: - name: Unshallow run: git fetch --prune --unshallow + - + name: Read go version + id: go-version + uses: juliangruber/read-file-action@v1 + with: + path: ./.go-version - name: Set up Go uses: actions/setup-go@v1 - with: # Ideally this should be picked up from .go-version rather than hard-coded - go-version: 1.14.1 + with: + go-version: ${{ steps.go-version.outputs.content }} - name: Snapshot build (cross-platform) uses: goreleaser/goreleaser-action@v1 @@ -45,11 +51,17 @@ jobs: - name: Unshallow run: git fetch --prune --unshallow + - + name: Read go version + id: go-version + uses: juliangruber/read-file-action@v1 + with: + path: ./.go-version - name: Set up Go uses: actions/setup-go@v1 - with: # Ideally this should be picked up from .go-version rather than hard-coded - go-version: 1.14.1 + with: + go-version: ${{ steps.go-version.outputs.content }} - name: Go mod verify run: go mod verify diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 42380b917..57d9f7795 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,11 +15,17 @@ jobs: - name: Unshallow run: git fetch --prune --unshallow + - + name: Read go version + id: go-version + uses: juliangruber/read-file-action@v1 + with: + path: ./.go-version - name: Set up Go uses: actions/setup-go@v1 - with: # Ideally this should be picked up from .go-version rather than hard-coded - go-version: 1.14.1 + with: + go-version: ${{ steps.go-version.outputs.content }} - name: Install hc-codesign run: | From 37f68f7121911b9d7ac0e848f7aa896a1ec73bed Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Tue, 7 Jul 2020 13:16:52 +0100 Subject: [PATCH 2/2] build: add comment to mention go-version-from-file PR --- .github/workflows/ci.yml | 4 ++++ .github/workflows/release.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1bce9246c..c5570abce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,8 @@ jobs: name: Set up Go uses: actions/setup-go@v1 with: + # TODO: Replace with go-version-from-file when it is supported + # https://github.com/actions/setup-go/pull/62 go-version: ${{ steps.go-version.outputs.content }} - name: Snapshot build (cross-platform) @@ -61,6 +63,8 @@ jobs: name: Set up Go uses: actions/setup-go@v1 with: + # TODO: Replace with go-version-from-file when it is supported + # https://github.com/actions/setup-go/pull/62 go-version: ${{ steps.go-version.outputs.content }} - name: Go mod verify diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57d9f7795..f340e37ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,8 @@ jobs: name: Set up Go uses: actions/setup-go@v1 with: + # TODO: Replace with go-version-from-file when it is supported + # https://github.com/actions/setup-go/pull/62 go-version: ${{ steps.go-version.outputs.content }} - name: Install hc-codesign