-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deps): use consistent Go version in builds and CI (#377)
* fix(deps): use consistent Go version in builds and CI * change go version in go.mod to go 1.21
- Loading branch information
1 parent
6487e85
commit 83cf380
Showing
7 changed files
with
88 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
latest=1.22.1 | ||
penultimate=1.21.8 | ||
latest=1.22.5 | ||
penultimate=1.21.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# The following chunk of yml boils down to pulling two Go version numbers out of a file and | ||
# making them available to the other workflows in a convenient fashion. | ||
# | ||
# It's a reusable workflow instead of an action so that its output can be used in a matrix strategy | ||
# of another job. | ||
# | ||
# The idea is to define the most recent, and penultimate, Go versions that should be used to test Relay. | ||
# Ideally we'd define these in a single place - otherwise we'd need to update many different places in | ||
# each workflow. This single place is .github/variables/go-versions.env. | ||
# | ||
# This reusable workflow grabs them out of the file, then sets them as outputs. As a convenience, it | ||
# also wraps each version in an array, so it can be directly used in a matrix strategy. Single-item matrices | ||
# are nice because you can tell instantly in the Github UI which version is being tested without needing | ||
# to inspect logs. | ||
# | ||
# To use a matrix output, e.g. latest version, do: | ||
# strategy: | ||
# matrix: ${{ fromJSON(this-job.outputs.latest-matrix) }} | ||
# | ||
name: Go Versions | ||
on: | ||
workflow_call: | ||
outputs: | ||
latest: | ||
description: 'The most recent Go version to test' | ||
value: ${{ jobs.go-versions.outputs.latest }} | ||
penultimate: | ||
description: 'The second most recent Go version to test' | ||
value: ${{ jobs.go-versions.outputs.penultimate }} | ||
matrix: | ||
description: 'All Go versions to test as a matrix' | ||
value: ${{ jobs.go-versions.outputs.all }} | ||
|
||
jobs: | ||
go-versions: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
latest: ${{ steps.set-env.outputs.latest }} | ||
penultimate: ${{ steps.set-env.outputs.penultimate }} | ||
all: ${{ steps.set-matrix.outputs.all }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set Go Versions | ||
id: set-env | ||
run: cat ./.github/variables/go-versions.env > $GITHUB_OUTPUT | ||
- name: Set Go Version Matrices | ||
id: set-matrix | ||
run: | | ||
echo "all=[\"${{ steps.set-env.outputs.latest }}\",\"${{ steps.set-env.outputs.penultimate }}\"]" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,11 @@ on: | |
type: string | ||
|
||
jobs: | ||
go-versions: | ||
uses: ./.github/workflows/go-versions.yml | ||
|
||
release-ldcli: | ||
needs: go-versions | ||
permissions: | ||
id-token: write # Needed to obtain Docker tokens | ||
contents: write # Needed to upload release artifacts | ||
|
@@ -31,6 +35,11 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ needs.go-versions.outputs.latest }} | ||
|
||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
name: 'Get Docker token' | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,9 @@ on: | |
- main | ||
|
||
jobs: | ||
go-versions: | ||
uses: ./.github/workflows/go-versions.yml | ||
|
||
release-please: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
|
@@ -21,7 +24,7 @@ jobs: | |
permissions: | ||
id-token: write # Needed to obtain Docker tokens | ||
contents: write # Needed to upload release artifacts | ||
needs: [ release-please ] | ||
needs: [ release-please, go-versions ] | ||
if: ${{ needs.release-please.outputs.release_created == 'true' }} | ||
runs-on: ubuntu-latest | ||
outputs: | ||
|
@@ -32,6 +35,11 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ needs.go-versions.outputs.latest }} | ||
|
||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
name: 'Get Docker token' | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/launchdarkly/ldcli | ||
|
||
go 1.20 | ||
go 1.21 | ||
|
||
require ( | ||
github.com/charmbracelet/bubbles v0.18.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters