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

feat(publish-cli): add manual trigger for CLI publish workflow #32323

Merged
merged 1 commit into from
Sep 3, 2024
Merged
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
11 changes: 10 additions & 1 deletion .github/workflows/publish-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ on:
paths:
- .github/workflows/publish-cli.yml
- client/go/**
workflow_dispatch:
inputs:
version:
description: 'The version to build and publish, it MUST be a tag in this repository without the "v" prefix.'
required: true
type: string

defaults:
run:
Expand All @@ -31,6 +37,8 @@ jobs:
if [[ "${{ github.event_name }}" == "push" && "${{ startswith(github.ref, 'refs/tags/v') }}" == "true" ]]; then
# Remove the "v" prefix from the tag.
BUILD_VERSION="${GITHUB_REF_NAME#*v}"
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
BUILD_VERSION="${{ github.event.inputs.version }}"
else
BUILD_VERSION="0.0.0-dev_${{ github.run_number }}"
fi
Expand Down Expand Up @@ -72,7 +80,8 @@ jobs:
publish:
runs-on: macos-latest

if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/v')
# Publish the CLI when a tag is pushed or a workflow is triggered manually.
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
needs:
- prepare
- build-test
Expand Down
Loading