mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 08:46:49 +02:00
release scripts
This commit is contained in:
parent
5a64e09204
commit
9ef6dec94a
4 changed files with 157 additions and 65 deletions
119
.github/workflows/release.yaml
vendored
Normal file
119
.github/workflows/release.yaml
vendored
Normal file
|
|
@ -0,0 +1,119 @@
|
||||||
|
name: "Release"
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
jobs:
|
||||||
|
build-linux-x86_64-extension:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: make loadable
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: sqlite-vec-linux-x86_64-extension
|
||||||
|
path: dist/*
|
||||||
|
build-macos-x86_64-extension:
|
||||||
|
runs-on: macos-11
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: make loadable
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: sqlite-vec-macos-x86_64-extension
|
||||||
|
path: dist/*
|
||||||
|
build-macos-aarch64-extension:
|
||||||
|
runs-on: macos-14
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: make loadable
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: sqlite-vec-macos-aarch64-extension
|
||||||
|
path: dist/*
|
||||||
|
build-windows-x86_64-extension:
|
||||||
|
runs-on: windows-2019
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: make loadable
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: sqlite-vec-windows-x86_64-extension
|
||||||
|
path: dist/*
|
||||||
|
dist:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
[
|
||||||
|
build-linux-x86_64-extension,
|
||||||
|
build-macos-x86_64-extension,
|
||||||
|
build-macos-aarch64-extension,
|
||||||
|
build-windows-x86_64-extension,
|
||||||
|
]
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: sqlite-vec-linux-x86_64-extension
|
||||||
|
path: dist/linux-x86_64
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: sqlite-vec-macos-x86_64-extension
|
||||||
|
path: dist/macos-x86_64
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: sqlite-vec-macos-aarch64-extension
|
||||||
|
path: dist/macos-aarch64
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: sqlite-vec-windows-x86_64-extension
|
||||||
|
path: dist/windows-x86_64
|
||||||
|
- run: |
|
||||||
|
curl -L https://github.com/asg017/sqlite-dist/releases/download/v0.0.1-alpha.3/sqlite-dist-x86_64-unknown-linux-gnu.tar.xz \
|
||||||
|
| tar xfJ - --strip-components 1
|
||||||
|
- run: ./sqlite-dist ./sqlite-dist.toml --input dist/ --output distx/
|
||||||
|
- run: |
|
||||||
|
gh release upload ${{ github.ref_name }} \
|
||||||
|
distx/github_releases/* \
|
||||||
|
distx/spm/* \
|
||||||
|
distx/sqlpkg/* \
|
||||||
|
distx/checksums.txt \
|
||||||
|
distx/sqlite-dist-manifest.json \
|
||||||
|
distx/install.sh
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
- name: Install node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
registry-url: "https://registry.npmjs.org"
|
||||||
|
- run: |
|
||||||
|
npm publish --access public distx/npm/sqlite-vec-darwin-arm64.tar.gz
|
||||||
|
npm publish --access public distx/npm/sqlite-vec-darwin-x64.tar.gz
|
||||||
|
npm publish --access public distx/npm/sqlite-vec-linux-x64.tar.gz
|
||||||
|
npm publish --access public distx/npm/sqlite-vec-windows-x64.tar.gz
|
||||||
|
npm publish --access public distx/npm/sqlite-vec.tar.gz
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
- uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 3.2
|
||||||
|
- run: |
|
||||||
|
for file in distx/gem/*; do
|
||||||
|
gem push "$file"
|
||||||
|
done
|
||||||
|
env:
|
||||||
|
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.12"
|
||||||
|
- run: pip install twine
|
||||||
|
- run: |
|
||||||
|
twine upload distx/pip/*
|
||||||
|
twine upload distx/datasette/*
|
||||||
|
twine upload distx/sqlite_utils/*
|
||||||
|
env:
|
||||||
|
TWINE_USERNAME: __token__
|
||||||
|
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
16
.github/workflows/test.yaml
vendored
16
.github/workflows/test.yaml
vendored
|
|
@ -9,43 +9,43 @@ jobs:
|
||||||
build-linux-x86_64-extension:
|
build-linux-x86_64-extension:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
- run: ./scripts/vendor.sh
|
- run: ./scripts/vendor.sh
|
||||||
- run: make loadable
|
- run: make loadable
|
||||||
- run: pip install pytest numpy; make test-loadable
|
- run: pip install pytest numpy; make test-loadable
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: sqlite-vec-linux-x86_64-extension
|
name: sqlite-vec-linux-x86_64-extension
|
||||||
path: dist/*
|
path: dist/*
|
||||||
build-macos-x86_64-extension:
|
build-macos-x86_64-extension:
|
||||||
runs-on: macos-11
|
runs-on: macos-11
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- run: ./scripts/vendor.sh
|
- run: ./scripts/vendor.sh
|
||||||
- run: make loadable
|
- run: make loadable
|
||||||
- run: /usr/local/opt/python@3/libexec/bin/python -m pip install pytest numpy; make test-loadable python=/usr/local/opt/python@3/libexec/bin/python
|
- run: /usr/local/opt/python@3/libexec/bin/python -m pip install pytest numpy; make test-loadable python=/usr/local/opt/python@3/libexec/bin/python
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: sqlite-vec-macos-x86_64-extension
|
name: sqlite-vec-macos-x86_64-extension
|
||||||
path: dist/*
|
path: dist/*
|
||||||
build-macos-aarch64-extension:
|
build-macos-aarch64-extension:
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- run: ./scripts/vendor.sh
|
- run: ./scripts/vendor.sh
|
||||||
- run: make loadable
|
- run: make loadable
|
||||||
- run: /opt/homebrew/opt/python3/libexec/bin/python -m pip install pytest numpy --break-system-packages; make test-loadable python=/opt/homebrew/opt/python3/libexec/bin/python
|
- run: /opt/homebrew/opt/python3/libexec/bin/python -m pip install pytest numpy --break-system-packages; make test-loadable python=/opt/homebrew/opt/python3/libexec/bin/python
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: sqlite-vec-macos-aarch64-extension
|
name: sqlite-vec-macos-aarch64-extension
|
||||||
path: dist/*
|
path: dist/*
|
||||||
build-windows-x86_64-extension:
|
build-windows-x86_64-extension:
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
|
|
@ -53,7 +53,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: make loadable
|
- run: make loadable
|
||||||
- run: pip install pytest numpy; make test-loadable
|
- run: pip install pytest numpy; make test-loadable
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: sqlite-vec-windows-x86_64-extension
|
name: sqlite-vec-windows-x86_64-extension
|
||||||
path: dist/*
|
path: dist/*
|
||||||
|
|
|
||||||
60
Makefile
60
Makefile
|
|
@ -151,69 +151,15 @@ lint:
|
||||||
|
|
||||||
progress:
|
progress:
|
||||||
deno run --allow-read=sqlite-vec.c scripts/progress.ts
|
deno run --allow-read=sqlite-vec.c scripts/progress.ts
|
||||||
|
|
||||||
test:
|
test:
|
||||||
sqlite3 :memory: '.read test.sql'
|
sqlite3 :memory: '.read test.sql'
|
||||||
|
|
||||||
.PHONY: version loadable static test clean gh-release \
|
.PHONY: version loadable static test clean gh-release
|
||||||
ruby
|
|
||||||
|
|
||||||
publish-release:
|
publish-release:
|
||||||
./scripts/publish_release.sh
|
./scripts/publish-release.sh
|
||||||
|
|
||||||
TARGET_WHEELS=$(prefix)/wheels
|
|
||||||
INTERMEDIATE_PYPACKAGE_EXTENSION=bindings/python/sqlite_vec/
|
|
||||||
|
|
||||||
$(TARGET_WHEELS): $(prefix)
|
|
||||||
mkdir -p $(TARGET_WHEELS)
|
|
||||||
|
|
||||||
bindings/ruby/lib/version.rb: bindings/ruby/lib/version.rb.tmpl VERSION
|
|
||||||
VERSION=$(VERSION) envsubst < $< > $@
|
|
||||||
|
|
||||||
bindings/python/sqlite_vec/version.py: bindings/python/sqlite_vec/version.py.tmpl VERSION
|
|
||||||
VERSION=$(VERSION) envsubst < $< > $@
|
|
||||||
echo "✅ generated $@"
|
|
||||||
|
|
||||||
bindings/datasette/datasette_sqlite_vec/version.py: bindings/datasette/datasette_sqlite_vec/version.py.tmpl VERSION
|
|
||||||
VERSION=$(VERSION) envsubst < $< > $@
|
|
||||||
echo "✅ generated $@"
|
|
||||||
|
|
||||||
python: $(TARGET_WHEELS) $(TARGET_LOADABLE) bindings/python/setup.py bindings/python/sqlite_vec/__init__.py scripts/rename-wheels.py
|
|
||||||
cp $(TARGET_LOADABLE) $(INTERMEDIATE_PYPACKAGE_EXTENSION)
|
|
||||||
rm $(TARGET_WHEELS)/*.wheel || true
|
|
||||||
pip3 wheel bindings/python/ -w $(TARGET_WHEELS)
|
|
||||||
python3 scripts/rename-wheels.py $(TARGET_WHEELS) $(RENAME_WHEELS_ARGS)
|
|
||||||
echo "✅ generated python wheel"
|
|
||||||
|
|
||||||
datasette: $(TARGET_WHEELS) bindings/datasette/setup.py bindings/datasette/datasette_sqlite_vec/__init__.py
|
|
||||||
rm $(TARGET_WHEELS)/datasette* || true
|
|
||||||
pip3 wheel bindings/datasette/ --no-deps -w $(TARGET_WHEELS)
|
|
||||||
|
|
||||||
bindings/sqlite-utils/pyproject.toml: bindings/sqlite-utils/pyproject.toml.tmpl VERSION
|
|
||||||
VERSION=$(VERSION) envsubst < $< > $@
|
|
||||||
echo "✅ generated $@"
|
|
||||||
|
|
||||||
bindings/sqlite-utils/sqlite_utils_sqlite_vec/version.py: bindings/sqlite-utils/sqlite_utils_sqlite_vec/version.py.tmpl VERSION
|
|
||||||
VERSION=$(VERSION) envsubst < $< > $@
|
|
||||||
echo "✅ generated $@"
|
|
||||||
|
|
||||||
sqlite-utils: $(TARGET_WHEELS) bindings/sqlite-utils/pyproject.toml bindings/sqlite-utils/sqlite_utils_sqlite_vec/version.py
|
|
||||||
python3 -m build bindings/sqlite-utils -w -o $(TARGET_WHEELS)
|
|
||||||
|
|
||||||
node: VERSION bindings/node/platform-package.README.md.tmpl bindings/node/platform-package.package.json.tmpl bindings/node/sqlite-vec/package.json.tmpl scripts/node_generate_platform_packages.sh
|
|
||||||
scripts/node_generate_platform_packages.sh
|
|
||||||
|
|
||||||
deno: VERSION bindings/deno/deno.json.tmpl
|
|
||||||
scripts/deno_generate_package.sh
|
|
||||||
|
|
||||||
|
|
||||||
version:
|
|
||||||
make bindings/ruby/lib/version.rb
|
|
||||||
make bindings/python/sqlite_vec/version.py
|
|
||||||
make bindings/datasette/datasette_sqlite_vec/version.py
|
|
||||||
make bindings/datasette/datasette_sqlite_vec/version.py
|
|
||||||
make bindings/sqlite-utils/pyproject.toml bindings/sqlite-utils/sqlite_utils_sqlite_vec/version.py
|
|
||||||
make node
|
|
||||||
make deno
|
|
||||||
|
|
||||||
test-loadable: loadable
|
test-loadable: loadable
|
||||||
$(PYTHON) -m pytest -vv -s tests/test-loadable.py
|
$(PYTHON) -m pytest -vv -s tests/test-loadable.py
|
||||||
|
|
|
||||||
27
scripts/publish-release.sh
Executable file
27
scripts/publish-release.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail xtrace
|
||||||
|
|
||||||
|
if [[ -n $(git status --porcelain | grep -v VERSION) ]]; then
|
||||||
|
echo "❌ There are other un-staged changes to the repository besides VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
VERSION="$(cat VERSION)"
|
||||||
|
|
||||||
|
echo "Publishing version v$VERSION..."
|
||||||
|
|
||||||
|
make version
|
||||||
|
git add --all
|
||||||
|
git commit -m "v$VERSION"
|
||||||
|
git tag v$VERSION
|
||||||
|
git push origin main v$VERSION
|
||||||
|
|
||||||
|
if grep -qE "alpha|beta" VERSION; then
|
||||||
|
gh release create v$VERSION --title=v$VERSION --prerelease --notes=""
|
||||||
|
else
|
||||||
|
gh release create v$VERSION --title=v$VERSION
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo "✅ Published! version v$VERSION"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue