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
6 changes: 6 additions & 0 deletions .changes/beta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"tauri-plugin-microphone-kessdev": "patch"
"tauri-plugin-microphone-kessdev-js": "patch"
---

First beta release to validate the automated release pipeline.
35 changes: 35 additions & 0 deletions .changes/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"gitSiteUrl": "https://github.com/kessdev/tauri-plugin-microphone/",
"pkgManagers": {
"rust": {
"version": true,
"getPublishedVersion": {
"use": "fetch:check",
"options": {
"url": "https://crates.io/api/v1/crates/${ pkg.pkgFile.pkg.package.name }/${ pkg.pkgFile.version }"
}
},
"publish": "cargo publish --no-verify"
},
"javascript": {
"version": true,
"getPublishedVersion": {
"use": "fetch:check",
"options": {
"url": "https://registry.npmjs.com/${ pkg.pkgFile.pkg.name }/${ pkg.pkgFile.version }"
}
},
"publish": "npm publish --access public"
}
},
"packages": {
"tauri-plugin-microphone-kessdev": {
"path": "./",
"manager": "rust"
},
"tauri-plugin-microphone-kessdev-js": {
"path": "./",
"manager": "javascript"
}
}
}
11 changes: 11 additions & 0 deletions .changes/fix-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"tauri-plugin-microphone-kessdev": "patch"
"tauri-plugin-microphone-kessdev-js": "patch"
---

Fix the CI verification across platforms: use npm as the single package manager
in the example app, install `libasound2-dev`/`pkg-config` for the Linux desktop
build, and resolve the in-process FLAC encoder at runtime on iOS so the Swift
package links without the Rust static library. Also make desktop
`onMeter`/`getAnalyserNode()` work regardless of subscription order and document
that native-format desktop recording has no metering.
8 changes: 8 additions & 0 deletions .changes/flac-mobile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"tauri-plugin-microphone-kessdev": "patch"
"tauri-plugin-microphone-kessdev-js": "patch"
---

Add FLAC recording on Android and iOS (in-process `flacenc` encoder, Option B)
and make unsupported-format degradation deterministic so the reported format,
file extension and container always match.
6 changes: 6 additions & 0 deletions .changes/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tag": "beta",
"changes": [
".changes/beta.md"
]
}
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: ci

on:
pull_request:
push:

jobs:
verify:
uses: ./.github/workflows/verify.yml
22 changes: 22 additions & 0 deletions .github/workflows/covector-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: covector status

on:
pull_request:

permissions:
contents: read

jobs:
covector:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: covector status
uses: jbolda/covector/packages/action@covector-v0
with:
command: 'status'
token: ${{ secrets.GITHUB_TOKEN }}
comment: true
61 changes: 61 additions & 0 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: covector version or publish

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
verify:
uses: ./.github/workflows/verify.yml

version-or-publish:
needs: verify
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
commandRan: ${{ steps.covector.outputs.commandRan }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'

- uses: dtolnay/rust-toolchain@stable

- name: install plugin dependencies
run: npm ci

- name: git config
run: |
git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}"

- name: covector version or publish
uses: jbolda/covector/packages/action@covector-v0
id: covector
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
with:
command: 'version-or-publish'
token: ${{ secrets.GITHUB_TOKEN }}
createRelease: true

- name: create pull request
if: steps.covector.outputs.commandRan == 'version'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release/version-updates
title: Apply Version Updates From Current Changes
commit-message: 'apply version updates'
body: ${{ steps.covector.outputs.change }}
171 changes: 171 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
name: verify

on:
workflow_call:

jobs:
verify-rust:
name: verify (rust / desktop)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
targets: aarch64-linux-android

- uses: Swatinem/rust-cache@v2

- name: install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libxdo-dev \
libssl-dev \
libasound2-dev \
pkg-config \
build-essential

- name: format
run: cargo fmt --all -- --check

- name: clippy
run: cargo clippy --all-targets -- -D warnings

- name: test
run: cargo test

- name: check mobile target
run: cargo check --target aarch64-linux-android

- name: check example app (desktop)
working-directory: examples/tauri-app/src-tauri
run: cargo check

verify-js:
name: verify (javascript)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: install
run: npm ci

- name: test
run: npm test

- name: build
run: npm run build

verify-android:
name: verify (android)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: install Android SDK packages
run: |
SDKMANAGER="$(find "$ANDROID_HOME/cmdline-tools" -type f -name sdkmanager 2>/dev/null | sort | tail -1)"
echo "Using sdkmanager: $SDKMANAGER"
echo "$(dirname "$SDKMANAGER")" >> "$GITHUB_PATH"
yes | "$SDKMANAGER" --licenses > /dev/null 2>&1 || true
"$SDKMANAGER" "platforms;android-36" "build-tools;36.0.0" "ndk;26.1.10909125"

- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android

- uses: Swatinem/rust-cache@v2

- name: setup Gradle (cache)
uses: gradle/actions/setup-gradle@v3

- name: build plugin JS bindings
run: |
npm ci
npm run build

- name: install example dependencies
working-directory: examples/tauri-app
run: npm ci

- name: generate Android project
working-directory: examples/tauri-app
run: npx tauri android init

- name: build Android (debug) — generates tauri.settings.gradle
working-directory: examples/tauri-app
run: npx tauri android build --debug

- name: run Kotlin unit tests
working-directory: examples/tauri-app/src-tauri/gen/android
run: ./gradlew test

verify-ios:
name: verify (ios)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- name: download Rust dependencies
run: cargo fetch

- name: link Tauri iOS API for the plugin tests
run: |
SRC="$(find "${CARGO_HOME:-$HOME/.cargo}/registry/src" -type d -path '*/tauri-*/mobile/ios-api' 2>/dev/null | sort | tail -1)"
echo "Tauri iOS API: $SRC"
test -n "$SRC"
mkdir -p .tauri
cp -R "$SRC" .tauri/tauri-api

- name: run Swift tests on iOS Simulator
working-directory: ios
run: |
xcodebuild -list -json
SCHEME="$(xcodebuild -list -json | python3 -c "import json,sys; d=json.load(sys.stdin); r=d.get('workspace') or d.get('project') or {}; s=r.get('schemes') or []; print(s[0] if s else '')")"
SIM="$(xcrun simctl list devices available | grep -m1 -E '^[[:space:]]+iPhone' | sed -E 's/^[[:space:]]+//; s/ \(.*//')"
echo "scheme=$SCHEME simulator=$SIM"
test -n "$SCHEME"
test -n "$SIM"
xcodebuild test -scheme "$SCHEME" -destination "platform=iOS Simulator,name=$SIM"

verify-windows:
name: verify (windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- name: format
run: cargo fmt --all -- --check

- name: clippy
run: cargo clippy --all-targets -- -D warnings

- name: test
run: cargo test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
*.sublime*
.idea/
debug.log
package-lock.json
.vscode/settings.json
yarn.lock

/.tauri
/android/.tauri/
/target
/examples/tauri-app/src-tauri/target/
/examples/tauri-app/src-tauri/gen/
/examples/tauri-app/dist/
Cargo.lock
node_modules/

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## 0.1.0-beta.0

- Initial beta: cross-platform microphone recording, live metering, raw audio
streaming, permissions and background recording scaffolding.
Loading
Loading