Skip to content

Add product docs and README TUI demo (#3) #3

Add product docs and README TUI demo (#3)

Add product docs and README TUI demo (#3) #3

Workflow file for this run

name: Version Bump
# Patch-bump and tag on every merge to main. workflow_dispatch keeps
# explicit patch/minor/major control. Skip commits that are already bumps
# so the bot cannot loop.
on:
push:
branches: [main]
workflow_dispatch:
inputs:
bump_type:
description: "Version bump type"
required: true
type: choice
options:
- patch
- minor
- major
create_release:
description: "Create release after bump"
required: false
type: boolean
default: true
permissions:
contents: write
jobs:
bump-version:
name: Bump Version
runs-on: ubuntu-latest
if: |
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'push' &&
!contains(github.event.head_commit.message, 'chore: bump version')
)
outputs:
new_version: ${{ steps.bump.outputs.new_version }}
old_version: ${{ steps.bump.outputs.old_version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump version
id: bump
run: |
OLD_VERSION=$(tr -d '[:space:]' < VERSION_CLI)
echo "old_version=$OLD_VERSION" >> "$GITHUB_OUTPUT"
Bump="${{ github.event_name == 'workflow_dispatch' && inputs.bump_type || 'patch' }}"
chmod +x ./scripts/bump-version.sh
./scripts/bump-version.sh "$Bump"
NEW_VERSION=$(tr -d '[:space:]' < VERSION_CLI)
echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
echo "Version bumped from $OLD_VERSION to $NEW_VERSION"
- name: Commit version bump
run: |
git add VERSION_CLI src/cortex-cli/VERSION Cargo.toml Cargo.lock
git commit -m "chore: bump version to ${{ steps.bump.outputs.new_version }}"
git push origin HEAD
- name: Create and push tag
if: github.event_name == 'push' || inputs.create_release
run: |
git tag "v${{ steps.bump.outputs.new_version }}"
git push origin "v${{ steps.bump.outputs.new_version }}"
notify:
name: Summary
runs-on: ubuntu-latest
needs: bump-version
steps:
- name: Summary
run: |
echo "## Version bump" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "| | |" >> "$GITHUB_STEP_SUMMARY"
echo "|---|---|" >> "$GITHUB_STEP_SUMMARY"
echo "| **Previous** | ${{ needs.bump-version.outputs.old_version }} |" >> "$GITHUB_STEP_SUMMARY"
echo "| **New** | ${{ needs.bump-version.outputs.new_version }} |" >> "$GITHUB_STEP_SUMMARY"