Skip to content

Commit

Permalink
fix rock-update to use major-minor go version (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabello authored Dec 7, 2023
1 parent 4bb7af4 commit 992db43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/rock-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ jobs:
go_version=$(grep -Po "^go \K(\S+)" $GITHUB_WORKSPACE/application-src/go.mod) \
# Delete the Go dependency and add the updated one
yq -i 'del(.parts.${{ inputs.rock-name }}.build-snaps.[] | select(. == "go/*"))' $GITHUB_WORKSPACE/main/$version/rockcraft.yaml
go_v="$go_version" yq -i '.parts.${{ inputs.rock-name }}.build-snaps += "go/"+strenv(go_v)+"/stable"' $GITHUB_WORKSPACE/main/$version/rockcraft.yaml
# Snap channels are named after major.minor only, so cut the go version to that format
go_major_minor=$(echo $go_version | sed -E "s/([0-9]+\.[0-9]+).*/\1/"))
go_v="$go_major_minor" yq -i '.parts.${{ inputs.rock-name }}.build-snaps += "go/"+strenv(go_v)+"/stable"' $GITHUB_WORKSPACE/main/$version/rockcraft.yaml
- name: Update other build dependencies
if: steps.check.outputs.release != '' && inputs.update-script != ''
Expand Down

0 comments on commit 992db43

Please sign in to comment.