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(cli): only publish if changes detected since last release #32433

Merged
merged 4 commits into from
Sep 20, 2024

Conversation

esolitos
Copy link
Contributor

@esolitos esolitos commented Sep 19, 2024

What

Changes on the "Publish Vespa CLI" Github workflow:

  1. The publish job now checks if there are any changes between the last release tag and the new version being published. This is done by using the git diff command to compare the changes in the client/go directory.
  2. If no changes are detected, the workflow will skip the publish step.
  3. The workflow also handles the case where a dev version (starting with "0.0.0-dev") is being used, in which case the changes check is skipped.

Why

This ensures that the CLI is only published when there are actual changes, preventing unnecessary releases.

A further reason is that we had 2 separate systems checking for changes, one for the Github Releases and another one for Homebrew, this leads to inconsistencies, so this PR merges the validation into an initial check.

Additional info

The changes in this commit focus on the CI workflow for publishing the CLI. The main changes are:

1. The publish job now checks if there are any changes between the last release tag and the new version being published. This is done by using the `git diff` command to compare the changes in the `client/go` directory.
2. If no changes are detected, the workflow will skip the publish step. This ensures that the CLI is only published when there are actual changes, preventing unnecessary releases.
3. The workflow also handles the case where a dev version (starting with "0.0.0-dev") is being used, in which case the changes check is skipped.
@esolitos esolitos self-assigned this Sep 19, 2024
@esolitos esolitos requested review from freva and aressem September 19, 2024 13:36
@esolitos esolitos marked this pull request as ready for review September 19, 2024 13:38
freva
freva previously approved these changes Sep 19, 2024
.github/workflows/publish-cli.yml Outdated Show resolved Hide resolved
…iff checks

The changes in this commit address the following:

1. Checkout the repository at the tagged version to ensure the correct code is used for the release.
2. Bypass the diff checks when publishing to GitHub and Homebrew, as these checks are already performed in the "prepare" job.
@esolitos esolitos force-pushed the publish-cli-publish-only-if-changes-detected branch from 19e6f9a to e9d02c8 Compare September 20, 2024 07:57
freva
freva previously approved these changes Sep 20, 2024
This change updates the GitHub Actions workflow to publish the Vespa CLI to both GitHub Releases and Homebrew. The key changes are:

- Publish the GitHub release and capture the release URL
- Only publish to Homebrew if a GitHub release was successful
- Install the CLI package via Homebrew if a release was published
@esolitos esolitos force-pushed the publish-cli-publish-only-if-changes-detected branch 2 times, most recently from 55024c2 to dc4205f Compare September 20, 2024 12:51
@esolitos esolitos merged commit 1a7c2a7 into master Sep 20, 2024
6 checks passed
@esolitos esolitos deleted the publish-cli-publish-only-if-changes-detected branch September 20, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] Ensure CI does not submit a new package version to homebrew without a Github Release
2 participants