mirror of
https://github.com/Heretek-AI/opencode-v2-plugin-teser.git
synced 2026-11-09 17:16:20 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9bc7ccf23 | ||
|
|
2245c87a8e |
No files matched your search
@@ -0,0 +1,30 @@
|
||||
name: publish
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22
|
||||
registry-url: https://registry.npmjs.org
|
||||
- run: bun install --frozen-lockfile
|
||||
- run: bun run check
|
||||
- name: Verify tag matches package.json version
|
||||
run: |
|
||||
TAG_VERSION="${GITHUB_REF_NAME#v}"
|
||||
PKG_VERSION="$(node --input-type=module -e "import { readFileSync } from 'node:fs'; console.log(JSON.parse(readFileSync('package.json', 'utf8')).version)")"
|
||||
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
|
||||
echo "Refusing to publish: tag ${GITHUB_REF_NAME} (version ${TAG_VERSION}) does not match package.json version ${PKG_VERSION}" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Publishing version ${PKG_VERSION} from tag ${GITHUB_REF_NAME}"
|
||||
- run: npm publish --provenance --access public
|
||||
@@ -28,13 +28,10 @@ in [schema/config.json](schema/config.json) and
|
||||
|
||||
From your plugin repo root:
|
||||
|
||||
> **NOTE: the package is not published to npm yet** (`0.1.0` unpublished),
|
||||
> so `bunx @heretek-ai/opencode-plugin-ci` 404s and the `$schema` URLs below
|
||||
> 404 too (editor schema assistance stays dead until publish). Until the
|
||||
> first publish, run the CLI from a source checkout: below,
|
||||
> `<checkout>` is your clone of this repo, and
|
||||
> `bun <checkout>/bin/opencode-plugin-ci.ts ...` takes the place of
|
||||
> `bunx @heretek-ai/opencode-plugin-ci ...`.
|
||||
> **NOTE:** the package is published as `@heretek-ai/opencode-plugin-ci`,
|
||||
> so `bunx @heretek-ai/opencode-plugin-ci ...` works directly. To run from
|
||||
> a source checkout instead, `<checkout>` below is your clone of this repo, and
|
||||
> `bun <checkout>/bin/opencode-plugin-ci.ts ...` takes the place of `bunx ...`.
|
||||
|
||||
```sh
|
||||
# 1. Scaffold starter files (.opencode-ci/config.yaml + an example scenario).
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@heretek-ai/opencode-plugin-ci",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"description": "Verify opencode v2 plugins actually work, locally and in GitHub Actions",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
|
||||
import { main } from "../../src/cli.ts";
|
||||
|
||||
describe("cli --version", () => {
|
||||
test("prints 0.1.0 and returns 0", async () => {
|
||||
test("prints 0.1.1 and returns 0", async () => {
|
||||
const lines: string[] = [];
|
||||
const origLog = console.log;
|
||||
console.log = (...args: unknown[]) => {
|
||||
@@ -14,6 +14,6 @@ describe("cli --version", () => {
|
||||
} finally {
|
||||
console.log = origLog;
|
||||
}
|
||||
expect(lines.join("\n")).toContain("0.1.0");
|
||||
expect(lines.join("\n")).toContain("0.1.1");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user