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

Release automation #579

Merged
merged 12 commits into from
Feb 13, 2025
17 changes: 17 additions & 0 deletions .github/workflows/bump.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Bump version
on:
workflow_dispatch:
env:
PACKAGE_NAME: client-sdk-swift
jobs:
bump:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.NANPA_KEY }}
- uses: nbsp/ilo@v1
with:
packages: ${{ env.PACKAGE_NAME }}
20 changes: 20 additions & 0 deletions .github/workflows/cocoapods.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Push to Cocoapods
on:
workflow_dispatch:
release:
types: [published]
env:
PODSPEC_FILE: LiveKitClient.podspec
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install Cocoapods
run: gem install cocoapods
- name: Validate Podspec
run: pod lib lint --allow-warnings
- name: Publish to CocoaPods
run: pod trunk push ${{ env.PODSPEC_FILE }} --allow-warnings --verbose
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
4 changes: 4 additions & 0 deletions .nanpa/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Add changeset files in this directory.

See nanpa documentation for more info:
https://github.com/nbsp/nanpa/blob/trunk/doc/nanpa-changeset.5.scd
3 changes: 3 additions & 0 deletions .nanparc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version 2.1.1
name client-sdk-swift
custom ./scripts/replace_version.sh
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
Use this SDK to add realtime video, audio and data features to your Swift app. By connecting to <a href="https://livekit.io/">LiveKit</a> Cloud or a self-hosted server, you can quickly build applications such as multi-modal AI, live streaming, or video calls with just a few lines of code.
<!--END_DESCRIPTION-->

[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Flivekit%2Fclient-sdk-swift%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/livekit/client-sdk-swift)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Flivekit%2Fclient-sdk-swift%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/livekit/client-sdk-swift)

## Docs & Example app

> [!NOTE]
Expand Down
File renamed without changes.
41 changes: 41 additions & 0 deletions scripts/replace_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh
# This script is invoked by nanpa with the new version set in VERSION.
# ed is used instead of sed to make this script POSIX compliant (run on Mac or Linux runner).

if [ -z "${VERSION}" ]; then
echo "Error: VERSION is not set. Exiting..."
exit 1
fi

replace() {
ed -s "$1" >/dev/null
if [ $? -ne 0 ]; then
echo "Error: unable to replace version in $1" >&2
exit 1
fi
}

# 1. Podspec version & tag
# -----------------------------------------
replace ./LiveKitClient.podspec <<EOF
,s/spec.version = "[^"]*"/spec.version = "${VERSION}"/g
,s/:tag => "[^"]*"/:tag => "${VERSION}"/g
w
q
EOF

# 2. README.md, installation guide
# -----------------------------------------
replace ./README.md <<EOF
,s/upToNextMajor("[^"]*")/upToNextMajor("${VERSION}")/g
w
q
EOF

# 3. LiveKitSDK class, static version constant
# -----------------------------------------
replace ./Sources/LiveKit/LiveKit.swift <<EOF
,s/static let version = "[^"]*"/static let version = "${VERSION}"/g
w
q
EOF
Loading