Skip to content

Working JavaScript Library #789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 28, 2023
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
42 changes: 32 additions & 10 deletions .github/workflows/javascript-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: deploy javascript sdk
on:
workflow_dispatch:
jobs:
build-javascript-sdk-linux:
build-javascript-sdk:
strategy:
matrix:
os: ["ubuntu-22.04", "buildjet-4vcpu-ubuntu-2204-arm", "macos-latest", "windows-latest"]
Expand All @@ -13,7 +13,7 @@ jobs:
os: "buildjet-4vcpu-ubuntu-2204-arm"
- neon-out-name: "x86_64-apple-darwin-index.node"
os: "macos-latest"
- neon-out-name: "x86_64-pc-windows-gnu.node"
- neon-out-name: "x86_64-pc-windows-gnu-index.node"
os: "windows-latest"
runs-on: ${{ matrix.os }}
defaults:
Expand All @@ -29,28 +29,50 @@ jobs:
with:
command: version
- name: Do build
env:
NEON_OUT_NAME: ${{ matrix.neon-out-name }}
run: |
npm i
npm run build-named
npm run build-release
mv index.node ${{ matrix.neon-out-name }}
- name: Display output files
run: ls -R
- name: Upload built .node file
uses: actions/upload-artifact@v3
with:
name: node-artifacts
path: ${{ matrix.neon-out-name }}
path: pgml-sdks/rust/pgml/javascript/${{ matrix.neon-out-name }}
retention-days: 1
publish-javascript-sdk:
needs: build-javascript-sdk
runs-on: "ubuntu-22.04"
defaults:
run:
working-directory: pgml-sdks/rust/pgml/javascript
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Validate cargo is working
uses: postgresml/gh-actions-cargo@master
with:
command: version
- name: Create artifact directory
run: mkdir dist
- uses: actions/download-artifact@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: node-artifacts
path: dist
- name: Display structure of download-artifacts
run: ls -R dist
path: pgml-sdks/rust/pgml/javascript/dist
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Generate types declaration
run: |
npm i
npm run build
rm index.node
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/python-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Create dist directory
run: mkdir ../../python/dist
- name: Build wheels
run: maturin build --release --strip -i python3.8 -i python3.9 -i python3.10 -i python3.11 -o ../../python/pgml/dist
run: maturin build --release --strip -i python3.8 -i python3.9 -i python3.10 -i python3.11 -o ../../python/pgml/dist -F python
- name: Deploy wheels
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Create dist directory
run: mkdir ../../python/dist
- name: Build wheels
run: maturin build --release --strip -i python3.8 -i python3.9 -i python3.10 -i python3.11 -o ../../python/pgml/dist
run: maturin build --release --strip -i python3.8 -i python3.9 -i python3.10 -i python3.11 -o ../../python/pgml/dist -F python
- name: Deploy wheels
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
- name: Create dist directory
run: mkdir ..\..\python\dist
- name: Build wheels
run: maturin build --release --strip -o ..\..\python\pgml\dist
run: maturin build --release --strip -o ..\..\python\pgml\dist -F python
- name: Deploy wheels
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
Expand Down
Loading