Skip to content

feat: automatically update latest tag for cli releases #3194

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

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

cabljac
Copy link
Contributor

@cabljac cabljac commented Jul 10, 2025

Summary

Updates CLI installation to use GitHub releases with automatic "latest" tag management and manual workflow triggers.

Changes

Install Script (bin/install_cli)

  • Updates download URL to use GitHub releases: https://github.com/firebase/genkit/releases/download/latest/genkit-$MACHINE
  • Maintains existing platform detection logic

Build Workflow (.github/workflows/build-cli-binaries.yml)

  • Manual trigger only: Removes push trigger, adds workflow inputs
  • New inputs: version (required) and upload_to_release (optional)
  • New jobs:
    • create-release: Creates GitHub release with download links
    • upload-assets: Uploads binaries as release assets
    • update-latest-tag: Updates "latest" tag to point to new release

Benefits

  • Static install URL that always points to latest version
  • Manual control over when releases happen
  • Maintains specific version tags for rollback capability

Usage

  • Test: Run workflow with upload_to_release unchecked
  • Release: Run workflow with upload_to_release checked and specify version

@cabljac cabljac force-pushed the @invertase/genkit-cli-release-tags branch from 5908b57 to 98d5253 Compare July 10, 2025 09:23
@cabljac cabljac requested a review from Copilot July 10, 2025 09:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the CLI build workflow to automate release management with a "latest" tag system. The changes enable manual release creation through GitHub Actions with automatic latest tag updates for simplified CLI installation.

  • Adds manual workflow inputs for version specification and optional release upload
  • Implements automated GitHub release creation with changelog generation
  • Creates a "latest" tag management system for consistent download URLs

Comment on lines +307 to +312
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.version }}
release_name: Genkit CLI ${{ inputs.version }}
Copy link
Preview

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actions/create-release@v1 action is deprecated. Consider using softprops/action-gh-release@v1 or the GitHub CLI (gh release create) for better maintenance and security.

Suggested change
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.version }}
release_name: Genkit CLI ${{ inputs.version }}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.version }}
name: Genkit CLI ${{ inputs.version }}

Copilot uses AI. Check for mistakes.


- name: Upload to GitHub Release
uses: actions/upload-release-asset@v1
Copy link
Preview

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actions/upload-release-asset@v1 action is deprecated. Consider using softprops/action-gh-release@v1 which can handle both release creation and asset uploads in a single step.

Copilot uses AI. Check for mistakes.

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
Copy link
Preview

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The create-release job doesn't expose upload_url as an output. You need to add outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} to the create-release job.

Copilot uses AI. Check for mistakes.

upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./genkit-${{ matrix.target }}${{ steps.binary.outputs.ext }}
asset_name: genkit-${{ matrix.target }}
Copy link
Preview

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The asset name should include the file extension for Windows binaries. Use genkit-${{ matrix.target }}${{ steps.binary.outputs.ext }} to ensure consistent naming with the actual file.

Suggested change
asset_name: genkit-${{ matrix.target }}
asset_name: genkit-${{ matrix.target }}${{ steps.binary.outputs.ext }}

Copilot uses AI. Check for mistakes.


```bash
TODO: Add installation instructions
Copy link
Preview

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The installation instructions placeholder should be replaced with actual installation commands before merging to production.

Suggested change
TODO: Add installation instructions
# For Linux (x64 or ARM64)
curl -LO https://github.com/firebase/genkit/releases/download/${{ inputs.version }}/genkit-linux-x64
chmod +x genkit-linux-x64
sudo mv genkit-linux-x64 /usr/local/bin/genkit
# For macOS (x64 or ARM64)
curl -LO https://github.com/firebase/genkit/releases/download/${{ inputs.version }}/genkit-darwin-x64
chmod +x genkit-darwin-x64
sudo mv genkit-darwin-x64 /usr/local/bin/genkit
# For Windows (x64)
curl -LO https://github.com/firebase/genkit/releases/download/${{ inputs.version }}/genkit-win32-x64.exe
move genkit-win32-x64.exe C:\Windows\System32\genkit.exe

Copilot uses AI. Check for mistakes.

Base automatically changed from @invertase/cli-binary to main July 11, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant