Skip to content

Commit

Permalink
use changesets/changesets for versioning (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbsp authored and theomonnom committed Jul 17, 2024
1 parent f948c36 commit 62bdbc7
Show file tree
Hide file tree
Showing 27 changed files with 1,193 additions and 114 deletions.
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) }}
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",
"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"
}
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"
}
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

0 comments on commit 62bdbc7

Please sign in to comment.