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

use changesets/changesets for versioning #409

Merged
merged 10 commits into from
Jul 8, 2024
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
16 changes: 16 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@livekit/changesets-changelog-github",
{
"repo": "livekit/agents"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"privatePackages": { "version": true, "tag": true }
}
12 changes: 0 additions & 12 deletions .github/workflows/publish-livekit-agents.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/publish-livekit-plugins-azure.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/publish-livekit-plugins-cartesia.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/publish-livekit-plugins-deepgram.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/publish-livekit-plugins-elevenlabs.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/publish-livekit-plugins-google.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/publish-livekit-plugins-nltk.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/publish-livekit-plugins-openai.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/publish-livekit-plugins-silero.yml

This file was deleted.

54 changes: 48 additions & 6 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,41 @@ permissions:
contents: read

jobs:
build:
bump:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.changesets.outputs.publishedPackages }}

steps:
- uses: pnpm/action-setup@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install pnpm dependencies
run: pnpm install

- name: Create Release Pull Request
id: changesets
uses: changesets/action@v1
with:
version: pnpm ci:version
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


build:
needs:
- bump
strategy:
matrix:
package: ${{ fromJson(needs.bump.outputs.packages) }}
lukasIO marked this conversation as resolved.
Show resolved Hide resolved
defaults:
run:
working-directory: ${{ inputs.package_name }}
working-directory: ${{ package.name }}

runs-on: ubuntu-latest

Expand All @@ -50,14 +80,19 @@ jobs:
python -m pip install --upgrade pip
pip install build

- name: Bump version.py
run: |
export module=$(sed 's/^.*\///' <<< ${{ package.name }} | tr '-' '/')
sed -i "s/__version__.*/__version__ = \"${{ package.version }}\"/" $module/version.py

- name: Build package
run: python -m build

- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: ${{ inputs.package_name}}/dist/
path: ${{ package.name }}/dist/

publish:

Expand All @@ -82,9 +117,16 @@ jobs:

docs:
needs:
- bump
- publish
strategy:
matrix:
package: ${{ needs.bump.outputs.packages }}

runs-on: ubuntu-latest
env:
package: $(sed 's/^.*\///' <<< ${{ package.name }})
module: $(tr '-' '/' <<< $package)

steps:
- uses: actions/checkout@v3
Expand All @@ -93,13 +135,13 @@ jobs:
run: python -m pip install --upgrade pdoc

- name: Install package
run: python -m pip install ${{ inputs.package_name }}/
run: python -m pip install $package/

- name: Build Docs
run: python -m pdoc ${{ inputs.package_module }} --docformat=google --output-dir docs
run: python -m pdoc $module --docformat=google --output-dir docs

- name: S3 Upload
run: aws s3 cp docs/ s3://livekit-docs/${{ inputs.package_name }} --recursive
run: aws s3 cp docs/ s3://livekit-docs/$package --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

node_modules
5 changes: 5 additions & 0 deletions livekit-agents/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "livekit-agents",
"private": true,
"version": "0.7.2"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright 2024 LiveKit, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
5 changes: 5 additions & 0 deletions livekit-plugins/livekit-plugins-azure/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "livekit-plugins/livekit-plugins-azure",
"private": true,
"version": "0.2.1"
}
5 changes: 5 additions & 0 deletions livekit-plugins/livekit-plugins-cartesia/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "livekit-plugins/livekit-plugins-cartesia",
Copy link
Member

Choose a reason for hiding this comment

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

If this is the name that will be shown to users, mb this is better?

Suggested change
"name": "livekit-plugins/livekit-plugins-cartesia",
"name": "livekit-plugins-cartesia",

Copy link
Member Author

Choose a reason for hiding this comment

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

this is because we don't know which packages are and which aren't under livekit-plugins unless we do this. it's easier to strip it in the CI than to figure out whether we need to add it

Copy link
Member Author

Choose a reason for hiding this comment

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

it's used programmatically to know where to cd in the CI

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can add a comment either in the publish-package.yml (or in the README) about what naming format we expect/need for this logic to work. Just as a reference once we add more lateron.

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe in the README for livekit-plugins-minimal, since that might be copied over as boilerplate for new packages?

Copy link
Contributor

@lukasIO lukasIO Jul 8, 2024

Choose a reason for hiding this comment

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

sounds good, the root README sounds also appropriate as the naming convention is not necessarily restricted to plugins

Copy link
Member Author

Choose a reason for hiding this comment

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

having trouble fitting this anywhere in the root README, it feels too end-user focused and this is internal dev doc
i think the plugin part is good, i don't assume we'll add anything to anywhere but the plugin directory in this repository

"private": true,
"version": "0.1.1"
}
5 changes: 5 additions & 0 deletions livekit-plugins/livekit-plugins-deepgram/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "livekit-plugins/livekit-plugins-deepgram",
"private": true,
"version": "0.5.1"
}
5 changes: 5 additions & 0 deletions livekit-plugins/livekit-plugins-elevenlabs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "livekit-plugins/livekit-plugins-elevenlabs",
"private": true,
"version": "0.6.0"
}
5 changes: 5 additions & 0 deletions livekit-plugins/livekit-plugins-google/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "livekit-plugins/livekit-plugins-google",
"private": true,
"version": "0.5.1"
}
7 changes: 7 additions & 0 deletions livekit-plugins/livekit-plugins-minimal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@

This is a minimal example of a LiveKit plugin for Agents.

### Developer note

When copying this directory over to create a new `livekit-plugins` package, make sure the `"name"` field in `package.json` follows the proper naming convention for CI:

```json
"name": "livekit-plugins/livekit-plugins-<name>"
```
5 changes: 5 additions & 0 deletions livekit-plugins/livekit-plugins-minimal/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "livekit-plugins/livekit-plugins-minimal",
"private": true,
"version": "0.1.0"
}
5 changes: 5 additions & 0 deletions livekit-plugins/livekit-plugins-nltk/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "livekit-plugins/livekit-plugins-nltk",
"private": true,
"version": "0.6.1"
}
5 changes: 5 additions & 0 deletions livekit-plugins/livekit-plugins-openai/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "livekit-plugins/livekit-plugins-openai",
"private": true,
"version": "0.6.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.6.0"
__version__ = "0.1.0"
5 changes: 5 additions & 0 deletions livekit-plugins/livekit-plugins-rag/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "livekit-plugins/livekit-plugins-rag",
"private": true,
"version": "0.1.0"
}
5 changes: 5 additions & 0 deletions livekit-plugins/livekit-plugins-silero/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "livekit-plugins/livekit-plugins-silero",
"private": true,
"version": "0.5.1"
}
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@livekit/agents-py-monorepo",
"private": true,
"type": "module",
"scripts": {
"changeset": "changeset",
"ci:publish": "changeset publish",
"ci:version": "changeset version"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@livekit/changesets-changelog-github": "^0.0.4"
},
"engines": {
"node": ">= 18"
},
"packageManager": "[email protected]"
}
Loading
Loading