feat: add drift-based reinjection, fact staleness filtering, session … #9
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 | |
| if: steps.version.outputs.skip != 'true' | |
| id: check | |
| run: | | |
| if npm view "opencode-graphiti@${{ steps.version.outputs.version }}" version 2>/dev/null; then | |
| echo "skip=true" >> "$GITHUB_OUTPUT" | |
| echo "Version ${{ steps.version.outputs.version }} already exists, skipping" | |
| else | |
| echo "skip=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Publish | |
| if: steps.version.outputs.skip != 'true' && steps.check.outputs.skip != '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' && steps.check.outputs.skip != 'true' | |
| run: | | |
| git tag "v${{ steps.version.outputs.version }}" | |
| git push origin "v${{ steps.version.outputs.version }}" | |
| gh release create "v${{ steps.version.outputs.version }}" --generate-notes | |
| env: | |
| GH_TOKEN: ${{ github.token }} |