Merge pull request #131 from CaviraOSS/copilot/fix-syntax-errors-in-w… #29
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 sdks | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'packages/openmemory-js/**' | |
| - 'packages/openmemory-py/**' | |
| workflow_dispatch: | |
| jobs: | |
| detect-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| js_changed: ${{ steps.filter.outputs.js }} | |
| py_changed: ${{ steps.filter.outputs.py }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| js: | |
| - 'packages/openmemory-js/**' | |
| py: | |
| - 'packages/openmemory-py/**' | |
| publish-js: | |
| needs: detect-changes | |
| runs-on: ubuntu-latest | |
| if: needs.detect-changes.outputs.js_changed == 'true' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: get version | |
| id: version | |
| run: | | |
| cd packages/openmemory-js | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Publishing openmemory-js@$VERSION" | |
| - name: install deps | |
| run: cd packages/openmemory-js && npm ci | |
| - name: build | |
| run: cd packages/openmemory-js && npm run build | |
| - name: publish | |
| run: cd packages/openmemory-js && npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: notify | |
| run: | | |
| echo "✅ Published openmemory-js@${{ steps.version.outputs.version }}" | |
| publish-py: | |
| needs: detect-changes | |
| runs-on: ubuntu-latest | |
| if: needs.detect-changes.outputs.py_changed == 'true' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: get version | |
| id: version | |
| run: | | |
| cd packages/openmemory-py | |
| VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Publishing openmemory-py@$VERSION" | |
| - name: install build tools | |
| run: pip install build twine | |
| - name: build | |
| run: cd packages/openmemory-py && python -m build | |
| - name: publish | |
| run: cd packages/openmemory-py && python -m twine upload dist/* --skip-existing | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
| - name: notify | |
| run: | | |
| echo "✅ Published openmemory-py@${{ steps.version.outputs.version }}" |