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
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: ci

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "24"
# The package has no dependencies and no lockfile, so there is nothing to install.
# The self-check needs no device and no socket: it reports both as absent and exits 0.
- run: npm test

publish:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
id-token: write # required for npm trusted publishing over OIDC
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
package-manager-cache: false # never cache in a release build

# Publishing a version that already exists fails with 409, so only publish when the
# version in package.json differs from the registry. Bump the version in the pull
# request, and the merge releases it.
- id: version
run: |
local_version=$(node -p "require('./package.json').version")
remote_version=$(npm view opencode-sidepulse version 2>/dev/null || echo none)
echo "local=$local_version remote=$remote_version"
if [ "$local_version" = "$remote_version" ]; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

# No NODE_AUTH_TOKEN. OIDC authenticates this workflow, and npm adds provenance.
- if: steps.version.outputs.changed == 'true'
run: npm publish
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"LICENSE"
],
"scripts": {
"test": "bun plugin.mjs"
"test": "node plugin.mjs"
}
}