From aaa8bc8fcbe96c58371daf86118d57eee58b955c Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Mon, 24 Apr 2023 14:29:24 +0200 Subject: [PATCH] Update go to 1.20 (#42) Update go to 1.20 Install dependencies with go mod download instead of go get Refactoring workflows (indentation and description) --- .github/workflows/build.yml | 27 ++++----------- .github/workflows/release.yml | 63 +++++++++++++++-------------------- go.mod | 2 +- 3 files changed, 34 insertions(+), 58 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63e725a..008da50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,24 +11,11 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - name: Set up Go - uses: actions/setup-go@v3 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 with: - go-version: 1.18 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v3 - - - name: Get dependencies - run: | - go get -v -t -d ./... - - - name: Run go tests - run: go test -v ./... - - - name: Build - run: go build -v . - - - name: Run e2e tests - run: ./test.sh + go-version: 1.20.x + - run: go mod download + - run: go test -v ./... + - run: go build -v . + - run: ./test.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 353e560..6e388a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,42 +8,31 @@ jobs: name: Release runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: 1.20.x + - run: go mod download + - run: go test -v ./... + - run: go build -v . + - run: ./test.sh - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.18 - id: go + - name: Create release + uses: actions/create-release@v1 + id: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false - - name: Check out code into the Go module directory - uses: actions/checkout@v3 - - - name: Get dependencies - run: | - go get -v -t -d ./... - - - name: Run tests - run: go test -v ./... - - - name: Build - run: go build -v . - - - name: Create release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - draft: false - - - name: Upload artifacts - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./crd-ref-docs - asset_name: crd-ref-docs - asset_content_type: application/octet-stream + - name: Upload artifacts + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.release.outputs.upload_url }} + asset_path: ./crd-ref-docs + asset_name: crd-ref-docs + asset_content_type: application/octet-stream diff --git a/go.mod b/go.mod index 0ebf103..e46b075 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/elastic/crd-ref-docs -go 1.18 +go 1.19 require ( github.com/Masterminds/sprig v2.22.0+incompatible