Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(CI): use the correct version for VespaCLI publishing #32233

Merged
merged 3 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/publish-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ jobs:
- prepare
- build-test

permissions:
contents: write

defaults:
run:
# This workflow only interacts with the client/go directory, so we can set the working directory here.
working-directory: client/go

env:
VERSION: ${{ needs.prepare.outputs.version }}
VERSION: ${{ needs.prepare.outputs.build-version }}

steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 11 additions & 1 deletion client/go/cond_make.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,16 @@ func latestReleasedTag(mirror string) (string, error) {
switch mirror {
case "github":
url := "https://api.github.com/repos/vespa-engine/vespa/releases/latest"
resp, err := http.Get(url)
token := "Bearer " + os.Getenv("GH_TOKEN")
esolitos marked this conversation as resolved.
Show resolved Hide resolved

req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Println("Error on setting up http request.\n[ERROR] -", err)
}
req.Header.Add("Authorization", token)

client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return "", err
}
Expand All @@ -100,6 +109,7 @@ func latestReleasedTag(mirror string) (string, error) {
return "", err
}
return release.TagName, nil

case "homebrew":
cmd, stdout, _ := newCmd("brew", "info", "--json", "--formula", "vespa-cli")
cmd.Stdout = stdout // skip printing output to os.Stdout
Expand Down
Loading