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
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,34 +325,55 @@ jobs:
command: ./gradlew --no-daemon :app:assembleSideloadDebug
- task: bundle-playstore
command: ./gradlew --no-daemon :app:bundlePlaystoreRelease
requires_signing: true
steps:
- name: Checkout
if: "!matrix.requires_signing || secrets.KEYSTORE_FILE != ''"
uses: actions/checkout@v4
with:
submodules: false

- name: Skip (no signing secrets)
if: matrix.requires_signing && secrets.KEYSTORE_FILE == ''
run: echo "Skipping ${{ matrix.task }} — KEYSTORE_FILE secret not configured"

- name: Setup Java
if: "!matrix.requires_signing || secrets.KEYSTORE_FILE != ''"
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: Setup Android SDK
if: "!matrix.requires_signing || secrets.KEYSTORE_FILE != ''"
uses: android-actions/setup-android@v3
with:
accept-android-sdk-licenses: false

- name: Setup Gradle
if: "!matrix.requires_signing || secrets.KEYSTORE_FILE != ''"
uses: gradle/actions/setup-gradle@v4

- name: Install Android SDK packages
if: "!matrix.requires_signing || secrets.KEYSTORE_FILE != ''"
run: |
yes | sdkmanager --licenses >/dev/null
sdkmanager --install \
"platform-tools" \
"platforms;android-36" \
"build-tools;36.0.0"

- name: Decode keystore
if: matrix.requires_signing && secrets.KEYSTORE_FILE != ''
working-directory: apps/android/app
run: echo "${{ secrets.KEYSTORE_FILE }}" | base64 -d > release.keystore

- name: Run Android ${{ matrix.task }}
if: "!matrix.requires_signing || secrets.KEYSTORE_FILE != ''"
working-directory: apps/android
run: ${{ matrix.command }}
env:
KEYSTORE_FILE: ${{ matrix.requires_signing && 'release.keystore' || '' }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
Original file line number Diff line number Diff line change
Expand Up @@ -236,5 +236,5 @@ describe("discord tool result dispatch", () => {
expect(sendMock).toHaveBeenCalledTimes(1);
expect(String(sendMock.mock.calls[0]?.[1] ?? "")).toContain("Your Discord user id: u2");
expect(String(sendMock.mock.calls[0]?.[1] ?? "")).toContain("Pairing code: PAIRCODE");
}, 10000);
}, 60_000);
});
4 changes: 2 additions & 2 deletions src/plugins/discovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe("discoverMayrosPlugins", () => {
});

const ids = candidates.map((c) => c.idHint);
expect(ids).toContain("mayros-voice-call");
expect(ids).toContain("voice-call");
});

it("treats configured directory paths as plugin packages", async () => {
Expand All @@ -137,7 +137,7 @@ describe("discoverMayrosPlugins", () => {
});

const ids = candidates.map((c) => c.idHint);
expect(ids).toContain("mayros-demo-plugin-dir");
expect(ids).toContain("demo-plugin-dir");
});
it("blocks extension entries that escape package directory", async () => {
const stateDir = makeTempDir();
Expand Down
10 changes: 8 additions & 2 deletions src/plugins/discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,17 @@ function deriveIdHint(params: {
}

// Prefer the unscoped name so config keys stay stable even when the npm
// package is scoped (example: @apilium/mayros-voice-call -> mayros-voice-call).
const unscoped = rawPackageName.includes("/")
// package is scoped (example: @apilium/mayros-voice-call -> voice-call).
let unscoped = rawPackageName.includes("/")
? (rawPackageName.split("/").pop() ?? rawPackageName)
: rawPackageName;

// Strip the "mayros-" prefix so the hint matches the short manifest id
// used in config keys (e.g. "mayros-bluebubbles" -> "bluebubbles").
if (unscoped.startsWith("mayros-")) {
unscoped = unscoped.slice("mayros-".length);
}

if (!params.hasMultipleExtensions) {
return unscoped;
}
Expand Down