Skip to content

Commit

Permalink
Update go to 1.20 (elastic#42)
Browse files Browse the repository at this point in the history
Update go to 1.20
Install dependencies with go mod download instead of go get
Refactoring workflows (indentation and description)
  • Loading branch information
thbkrkr committed Apr 24, 2023
1 parent 7444d6a commit aaa8bc8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 58 deletions.
27 changes: 7 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
63 changes: 26 additions & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit aaa8bc8

Please sign in to comment.