Skip to content

Commit

Permalink
ci: Update dependencies and read Go version from go.mod file
Browse files Browse the repository at this point in the history
Caching is also automatically set up by setup-go.
  • Loading branch information
Brawl345 committed May 28, 2024
1 parent c7c871c commit 6b8599c
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
- pull_request

env:
GOVER: ^1.21
NAME: gobot

jobs:
Expand All @@ -21,22 +20,12 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOVER }}
go-version-file: 'go.mod'

- name: Build
env:
Expand All @@ -49,7 +38,7 @@ jobs:
run: for x in dist/$NAME-windows-*; do mv $x $x.exe; done

- name: Upload binary
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{env.NAME}}-${{ matrix.GOOS }}-${{ matrix.GOARCH }}-${{github.sha}}
path: dist/*
Expand Down

0 comments on commit 6b8599c

Please sign in to comment.