Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
14 changes: 0 additions & 14 deletions .github/release.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Run linter
shell: bash
run: |
uv sync --all-extras --all-packages
uv run -- pre-commit run -a
- name: Install dev dependencies
run: uv sync --all-extras --all-packages

- name: Run pre-commit
run: uv run pre-commit run -a
82 changes: 82 additions & 0 deletions .github/workflows/publish_changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Version Bump and Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
# Only run on main branch pushes
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout Repo
uses: actions/checkout@v5

- uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "22"
cache: "pnpm"

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.11"

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install dependencies
run: pnpm install

- name: Create Release Pull Request or Publish packages
id: changesets
uses: changesets/action@v1
with:
commit: "chore: version packages"
title: "chore: version packages"
# Custom version script
version: pnpm -w run version
# Custom publish script
publish: pnpm -w run publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}

- name: Generate GitHub App token
if: steps.changesets.outputs.published == 'true'
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CI_BOT_APP_ID }}
private-key: ${{ secrets.CI_BOT_PRIVATE_KEY }}

- name: Extract published llama-index-workflows version
if: steps.changesets.outputs.published == 'true'
id: workflows-version
run: |
PACKAGES='${{ steps.changesets.outputs.publishedPackages }}'
VERSION=$(echo "$PACKAGES" | jq -r '.[] | select(.name == "llama-index-workflows") | .version')

if [ -n "$VERSION" ]; then
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=llama-index-workflows@v${VERSION}" >> "$GITHUB_OUTPUT"
echo "Found llama-index-workflows version: $VERSION"
else
echo "llama-index-workflows was not published in this release"
fi

- name: Trigger OpenAPI publish for llama-index-workflows
if: steps.changesets.outputs.published == 'true' && steps.workflows-version.outputs.version != ''
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.app-token.outputs.token }}
event-type: publish-openapi
client-payload: '{"tag": "${{ steps.workflows-version.outputs.tag }}"}'
97 changes: 97 additions & 0 deletions .github/workflows/publish_openapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Publish OpenAPI specification

on:
workflow_dispatch:
inputs:
tag:
description: "Release tag to update (e.g. llama-index-workflows@v2.12.0)"
required: true
type: string
repository_dispatch:
types: [publish-openapi]

jobs:
publish-openapi:
if: github.repository == 'run-llama/workflows-py'
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Resolve target tag
id: target
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG="${{ github.event.inputs.tag }}"
else
TAG="${{ github.event.client_payload.tag }}"
fi
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "TARGET_TAG=${TAG}" >> "$GITHUB_ENV"

- name: Extract version information
id: version
run: >
uv run --package workflows-dev workflows-dev extract-tag-info
--tag "${{ env.TARGET_TAG }}"
--tag-prefix "llama-index-workflows@"
--output "$GITHUB_OUTPUT"

- name: Sync dependencies and build OpenAPI spec
working-directory: packages/llama-index-workflows
run: |
uv sync --all-extras
uv run hatch run server:openapi

- name: Upload OpenAPI to release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.TARGET_TAG }}
files: packages/llama-index-workflows/openapi.json
fail_on_unmatched_files: true
append_body: false

- name: Detect change type automatically
id: detect_change
env:
GITHUB_REF: refs/tags/${{ env.TARGET_TAG }}
run: >
uv run --package workflows-dev workflows-dev detect-change-type
--tag-glob "llama-index-workflows@v*"
--tag-prefix "llama-index-workflows@"

- name: Resolve change metadata
id: metadata
run: |
echo "change_type=${{ steps.detect_change.outputs.change_type }}" >> "$GITHUB_OUTPUT"
echo "change_description=" >> "$GITHUB_OUTPUT"

- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CI_BOT_APP_ID }}
private-key: ${{ secrets.CI_BOT_PRIVATE_KEY }}
owner: run-llama

- name: Trigger SDK update
if: >
steps.metadata.outputs.change_type != '' &&
steps.metadata.outputs.change_type != 'none'
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.app-token.outputs.token }}
repository: run-llama/llama-ui
event-type: workflows-sdk-update
client-payload: >-
{"version": "${{ steps.version.outputs.semver }}",
"openapi_url": "https://github.com/run-llama/workflows-py/releases/download/${{ env.TARGET_TAG }}/openapi.json",
"change_type": "${{ steps.metadata.outputs.change_type }}",
"change_description": "${{ steps.metadata.outputs.change_description }}"}
100 changes: 0 additions & 100 deletions .github/workflows/publish_release.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/publish_release_utils.yml

This file was deleted.

Loading