Skip to content

Commit

Permalink
feat(publish0cli): add manual trigger for CLI publish workflow
Browse files Browse the repository at this point in the history
Adds a manual workflow trigger to the CLI publish workflow to allow manually triggering the publish process with a specific version.
This provides a way to manually publish a new CLI version without needing to create a new git tag.
  • Loading branch information
esolitos authored and gitbutler-client committed Sep 3, 2024
1 parent 92bba6e commit 091b0f1
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit 091b0f1

Please sign in to comment.