feat!: align hot-path session memory with context-mode #82
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Test | |
| run: deno test -A | |
| - name: Calculate version | |
| id: version | |
| run: deno run -A .github/scripts/version.ts | |
| env: | |
| COMMIT_SHA: ${{ github.event.pull_request.head.sha || '' }} | |
| - name: Build | |
| if: steps.version.outputs.skip != 'true' | |
| run: deno task build | |
| env: | |
| VERSION: ${{ steps.version.outputs.version }} | |
| - uses: actions/setup-node@v4 | |
| if: steps.version.outputs.skip != 'true' | |
| with: | |
| node-version: 24 | |
| - name: Check if version exists on npm | |
| if: steps.version.outputs.skip != 'true' | |
| id: npm | |
| run: | | |
| if npm view "opencode-graphiti@${{ steps.version.outputs.version }}" version 2>/dev/null; then | |
| echo "publish=false" >> "$GITHUB_OUTPUT" | |
| echo "Version ${{ steps.version.outputs.version }} already exists on npm, skipping publish" | |
| else | |
| echo "publish=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Publish | |
| if: steps.version.outputs.skip != 'true' && steps.npm.outputs.publish == 'true' | |
| working-directory: dist | |
| run: npm publish --provenance --access public --tag ${{ steps.version.outputs.tag }} | |
| - name: Tag and Release | |
| if: github.event_name == 'push' && steps.version.outputs.skip != 'true' | |
| run: | | |
| set -euo pipefail | |
| tag="v${{ steps.version.outputs.version }}" | |
| if git show-ref --verify --quiet "refs/tags/$tag"; then | |
| echo "Tag $tag already exists locally" | |
| elif git ls-remote --exit-code --tags origin "refs/tags/$tag" >/dev/null 2>&1; then | |
| git fetch --tags origin | |
| echo "Tag $tag already exists on origin" | |
| else | |
| git tag "$tag" | |
| git push origin "$tag" | |
| fi | |
| if gh release view "$tag" >/dev/null 2>&1; then | |
| echo "Release $tag already exists" | |
| else | |
| gh release create "$tag" --generate-notes | |
| fi | |
| env: | |
| GH_TOKEN: ${{ github.token }} |