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

View file

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

View file

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