Skip to content

Commit

Permalink
add nanpa version management support
Browse files Browse the repository at this point in the history
this adds support for versioning through
[nanpa](https://github.com/nbsp/nanpa), via the
[ilo](https://github.com/nbsp/ilo) GitHub bot.

usage guide:
1. on PRs, for each change, add a file to `.nanpa/<unique-name>.kdl`,
   that looks like this:

    patch type="added" package="livekit-ffi" "Add support for foo"

   alternatively you may add the file to `./livekit-ffi/.nanpa/`,
   and then drop the `package="livekit-ffi"`.

   `type`s follow [Keep a Changelog](https://keepachangelog.org).
2. ilo will create an issue when there's changes in the main branch.
   use the checkboxes to pick which ones you want to bump.
   additionally, if you want to set a prerelease version on a package:

    ilo prerelease rust-sdks/livekit-ffi alpha

   or to un-prerelease a package:

    ilo prerelease rust-sdks/livekit-ffi
3. close the issue, and the workflow should run, making a new commit
   and tagging it with all changed package versions.

note that when updating a package and its dependent, you need to either
bump them seperately, or manually update the dependency's Cargo.toml,
and then edit the dependent's manifest to include the new dep version.

repo settings that need to change:

- add [ilo](https://github.com/apps/ilo-nanpa) to the repository
- set the `NANPA_WORKFLOW` environmental variable to `publish.yml`,
  for CI (not as a secret!)
  • Loading branch information
nbsp committed Sep 14, 2024
1 parent 1b87c1a commit 30f6580
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 12 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,41 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Publish crates
name: Bump and publish crates

on:
push:
tags:
- v*
workflow_dispatch:
inputs:
packages:
description: "packages to bump"
type: string
required: true

env:
CARGO_TERM_COLOR: always
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}

jobs:
bump:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nbsp/ilo@v1
with:
packages: ${{ github.event.inputs.packages }}
publish:
runs-on: windows-latest
runs-on: ubuntu-latest
needs: bump
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Publish crates
run: |
cd livekit-protocol && cargo publish --no-verify
cd ../webrtc-sys/build && cargo publish --no-verify
cd ../../webrtc-sys && cargo publish --no-verify
cd ../libwebrtc && cargo publish --no-verify
cd ../livekit-api && cargo publish --no-verify
cd ../livekit && cp ../README.md README.md && cargo publish --allow-dirty --no-verify
cd ../livekit-ffi && cargo publish --no-verify
git tag --points-at HEAD |
sed 's|^[^/]*@|@|' |
sed 's|^[^/]*/||' |
sed 's|@.*||' |
xargs -I _ sh -c 'cd ./_ && cargo publish --no-verify'
1 change: 1 addition & 0 deletions .nanparc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages livekit livekit-ffi livekit-protocol livekit-runtime livekit-api libwebrtc webrtc-sys webrtc-sys/build
2 changes: 2 additions & 0 deletions libwebrtc/.nanparc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version 0.3.7
language rust
2 changes: 2 additions & 0 deletions livekit-api/.nanparc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version 0.4.0
language rust
2 changes: 2 additions & 0 deletions livekit-ffi/.nanparc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version 0.10.2
language rust
2 changes: 2 additions & 0 deletions livekit-protocol/.nanparc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version 0.3.5
language rust
2 changes: 2 additions & 0 deletions livekit-runtime/.nanparc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version 0.3.0
language rust
2 changes: 2 additions & 0 deletions livekit/.nanparc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version 0.6.0
language rust
2 changes: 2 additions & 0 deletions webrtc-sys/.nanparc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version 0.3.5
language rust
2 changes: 2 additions & 0 deletions webrtc-sys/build/.nanparc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version 0.3.5
language rust

0 comments on commit 30f6580

Please sign in to comment.