Release #8
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: "Release" | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-linux-x86_64-extension: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: ./scripts/vendor.sh | |
| - run: make loadable static | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sqlite-vec-linux-x86_64-extension | |
| path: dist/* | |
| build-macos-x86_64-extension: | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: ./scripts/vendor.sh | |
| - run: make loadable static CC="clang -target x86_64-apple-darwin" TARGET_ARCH=x86_64 | |
| - 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@v4 | |
| - run: ./scripts/vendor.sh | |
| - run: make loadable static | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sqlite-vec-macos-aarch64-extension | |
| path: dist/* | |
| build-windows-x86_64-extension: | |
| runs-on: windows-2019 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: ./scripts/vendor.sh | |
| shell: bash | |
| - run: make sqlite-vec.h | |
| - run: mkdir dist | |
| - run: cl.exe /fPIC -shared /W4 /Ivendor/ /O2 /LD sqlite-vec.c -o dist/vec0.dll | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sqlite-vec-windows-x86_64-extension | |
| path: dist/* | |
| build-linux-aarch64-extension: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: sudo apt-get install gcc-aarch64-linux-gnu | |
| - run: ./scripts/vendor.sh | |
| - run: make sqlite-vec.h | |
| - run: make CC=aarch64-linux-gnu-gcc loadable static | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sqlite-vec-linux-aarch64-extension | |
| path: dist/* | |
| build-cosmopolitan: | |
| runs-on: macos-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| mkdir $HOME/cosmo | |
| curl -L -o cosmocc-$COSMO_VERSION.zip https://github.com/jart/cosmopolitan/releases/download/$COSMO_VERSION/cosmocc-$COSMO_VERSION.zip | |
| unzip cosmocc-$COSMO_VERSION.zip -d $HOME/cosmo | |
| env: | |
| COSMO_VERSION: "3.5.4" | |
| - run: ./scripts/vendor.sh | |
| - run: make cli CC=$HOME/cosmo/bin/cosmocc AR=$HOME/cosmo/bin/cosmoar OMIT_SIMD=1 | |
| - run: tar -czvf sqlite-vec-$(cat VERSION)-cli-cosmopolitan.tar.gz dist/sqlite3 | |
| - run: gh release upload ${{ github.ref_name }} sqlite-vec-$(cat VERSION)-cli-cosmopolitan.tar.gz | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sqlite-vec-cosmopolitan | |
| path: dist/* | |
| build-wasm32-emscripten: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mymindstorm/setup-emsdk@v12 | |
| with: | |
| version: "latest" | |
| - run: ./scripts/vendor.sh | |
| - run: make sqlite-vec.h | |
| - run: make wasm | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sqlite-vec-wasm32-emscripten | |
| path: dist/.wasm/* | |
| include-hidden-files: true | |
| build-android-extensions: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| platforms: | |
| [ | |
| { name: android-aarch64, cc: aarch64-linux-android21-clang }, | |
| { name: android-i686, cc: i686-linux-android21-clang }, | |
| { name: android-x86_64, cc: x86_64-linux-android21-clang }, | |
| { name: android-armv7a, cc: armv7a-linux-androideabi21-clang }, | |
| ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: ./scripts/vendor.sh | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| - uses: android-actions/setup-android@v3 | |
| - run: | | |
| sdkmanager --install "ndk;27.0.12077973" | |
| echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/27.0.12077973" >> $GITHUB_ENV | |
| - run: | | |
| ls $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/ | |
| ls $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin | |
| - run: | | |
| export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH | |
| make CC=${{ matrix.platforms.cc }} \ | |
| AR=llvm-ar \ | |
| RANLIB=llvm-ranlib \ | |
| STRIP=llvm-strip loadable | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sqlite-vec-${{ matrix.platforms.name }}-extension | |
| path: dist/*.so | |
| build-ios-extensions: | |
| runs-on: ${{ matrix.platforms.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platforms: [ | |
| { | |
| name: ios-aarch64, | |
| target: arm64-apple-ios, | |
| sdk: iphoneos, | |
| runner: macos-14, | |
| }, | |
| #{ | |
| # name: ios-x86_64, | |
| # target: x86_64-apple-ios, | |
| # sdk: iphoneos, | |
| # runner: macos-12, | |
| #}, | |
| { | |
| name: iossimulator-aarch64, | |
| target: arm64-apple-ios-simulator, | |
| sdk: iphonesimulator, | |
| runner: macos-14, | |
| }, | |
| { | |
| name: iossimulator-x86_64, | |
| target: x86_64-apple-ios-simulator, | |
| sdk: iphonesimulator, | |
| runner: macos-14, | |
| }, | |
| ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - run: ./scripts/vendor.sh | |
| - run: make CFLAGS="-target ${{ matrix.platforms.target }} -isysroot $(xcrun -sdk ${{ matrix.platforms.sdk }} --show-sdk-path) -fembed-bitcode -DNDEBUG=1" loadable static | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sqlite-vec-${{ matrix.platforms.name }}-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, | |
| build-wasm32-emscripten, | |
| build-android-extensions, | |
| build-ios-extensions, | |
| ] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - 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-linux-aarch64-extension | |
| path: dist/linux-aarch64 | |
| - 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 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sqlite-vec-wasm32-emscripten | |
| path: dist/wasm32-emscripten | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sqlite-vec-android-aarch64-extension | |
| path: dist/android-aarch64 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sqlite-vec-android-i686-extension | |
| path: dist/android-i686 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sqlite-vec-android-x86_64-extension | |
| path: dist/android-x86_64 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sqlite-vec-android-armv7a-extension | |
| path: dist/android-armv7a | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sqlite-vec-ios-aarch64-extension | |
| path: dist/ios-aarch64 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sqlite-vec-iossimulator-aarch64-extension | |
| path: dist/iossimulator-aarch64 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sqlite-vec-iossimulator-x86_64-extension | |
| path: dist/iossimulator-x86_64 | |
| - run: | | |
| curl -L https://github.com/asg017/sqlite-dist/releases/download/v0.0.1-alpha.17/sqlite-dist-x86_64-unknown-linux-gnu.tar.xz \ | |
| | tar xfJ - --strip-components 1 | |
| - run: make sqlite-vec.h | |
| - run: ./sqlite-dist ./sqlite-dist.toml --input dist/ --output distx/ --version $(cat VERSION) | |
| - run: | | |
| gh release upload ${{ github.ref_name }} \ | |
| distx/amalgamation/* \ | |
| distx/github_releases/* \ | |
| distx/spm/* \ | |
| distx/sqlpkg/* \ | |
| distx/checksums.txt \ | |
| distx/sqlite-dist-manifest.json \ | |
| distx/install.sh \ | |
| --clobber | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| - run: ./scripts/vendor.sh | |
| - run: make sqlite-vec.h | |
| - run: make deps | |
| - run: | | |
| mkdir -p ~/.config/dart | |
| echo '${{ secrets.PUB_CREDENTIALS }}' > ~/.config/dart/pub-credentials.json | |
| sed -i "s/^version: .*/version: $(cat ../../VERSION)/" pubspec.yaml | |
| # Prepend version to CHANGELOG.md if not present | |
| VERSION=$(cat ../../VERSION) | |
| if ! grep -q "## $VERSION" CHANGELOG.md; then | |
| echo "## $VERSION" > CHANGELOG.tmp | |
| echo "" >> CHANGELOG.tmp | |
| echo "* Release $VERSION" >> CHANGELOG.tmp | |
| echo "" >> CHANGELOG.tmp | |
| cat CHANGELOG.md >> CHANGELOG.tmp | |
| mv CHANGELOG.tmp CHANGELOG.md | |
| fi | |
| flutter pub publish -f | |
| working-directory: bindings/dart |