Use env variable to specify Go version in CI

This commit is contained in:
eikendev 2023-09-24 22:36:06 +02:00
parent 78a99281a7
commit e426b46f28
No known key found for this signature in database
GPG key ID: A1BDB1B28C8EF694
3 changed files with 12 additions and 8 deletions

View file

@ -6,6 +6,7 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'
env:
GO_VERSION: '1.21.1'
PB_BUILD_VERSION: unknown # Needed for using Make targets.
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
@ -21,7 +22,7 @@ jobs:
- name: Export GOBIN
uses: actions/setup-go@v4
with:
go-version: '1.21.1'
go-version: '${{env.GO_VERSION}}'
- name: Install dependencies
run: make setup

View file

@ -5,6 +5,9 @@ on:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
env:
GO_VERSION: '1.21.1'
jobs:
test:
name: Test
@ -19,7 +22,7 @@ jobs:
- name: Export GOBIN
uses: actions/setup-go@v4
with:
go-version: '1.21.1'
go-version: '${{env.GO_VERSION}}'
- name: Install dependencies
run: make setup
@ -86,7 +89,7 @@ jobs:
- name: Export GOBIN
uses: actions/setup-go@v4
with:
go-version: '1.20.5'
go-version: '${{env.GO_VERSION}}'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4

View file

@ -3,13 +3,13 @@ name: Test
on:
push:
branches:
- '**'
tags:
- '**'
- '!v[0-9]+.[0-9]+.[0-9]+'
- 'main'
pull_request:
branches:
- 'main'
env:
GO_VERSION: '1.21.1'
PB_BUILD_VERSION: pipeline-${{ github.sha }}
jobs:
@ -24,7 +24,7 @@ jobs:
- name: Export GOBIN
uses: actions/setup-go@v4
with:
go-version: '1.21.1'
go-version: '${{env.GO_VERSION}}'
- name: Install dependencies
run: make setup