Skip to content

chore: bump version to 0.0.5 #4

chore: bump version to 0.0.5

chore: bump version to 0.0.5 #4

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-cli:
name: Build CLI ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: linux-x86_64
- target: aarch64-apple-darwin
os: macos-latest
name: darwin-aarch64
- target: x86_64-pc-windows-msvc
os: windows-latest
name: windows-x86_64
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Prepare artifact (Unix)
if: runner.os != 'Windows'
run: |
cp target/${{ matrix.target }}/release/embedded-postgres embedded-postgres-${{ matrix.name }}
chmod +x embedded-postgres-${{ matrix.name }}
- name: Prepare artifact (Windows)
if: runner.os == 'Windows'
run: |
copy target\${{ matrix.target }}\release\embedded-postgres.exe embedded-postgres-${{ matrix.name }}.exe
- name: Upload artifact (Unix)
if: runner.os != 'Windows'
uses: actions/upload-artifact@v4
with:
name: cli-${{ matrix.name }}
path: embedded-postgres-${{ matrix.name }}
- name: Upload artifact (Windows)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: cli-${{ matrix.name }}
path: embedded-postgres-${{ matrix.name }}.exe
build-postgres-bundle:
name: Bundle PostgreSQL ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
name: darwin-aarch64
pg_target: aarch64-apple-darwin
- os: ubuntu-latest
name: linux-x86_64
pg_target: x86_64-unknown-linux-gnu
- os: windows-latest
name: windows-x86_64
pg_target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
- name: Load versions
id: versions
shell: bash
run: |
source versions.env
echo "PG_VERSION=$PG_VERSION" >> $GITHUB_OUTPUT
echo "PGVECTOR_VERSION=$PGVECTOR_VERSION" >> $GITHUB_OUTPUT
echo "PGVECTOR_COMPILED_TAG=$PGVECTOR_COMPILED_TAG" >> $GITHUB_OUTPUT
echo "PGVECTOR_COMPILED_REPO=${PGVECTOR_COMPILED_REPO:-portalcorp/pgvector_compiled}" >> $GITHUB_OUTPUT
- name: Download PostgreSQL
shell: bash
run: |
mkdir -p bundle
PG_URL="https://github.com/theseus-rs/postgresql-binaries/releases/download/${{ steps.versions.outputs.PG_VERSION }}/postgresql-${{ steps.versions.outputs.PG_VERSION }}-${{ matrix.pg_target }}.tar.gz"
echo "Downloading PostgreSQL from $PG_URL"
curl -fsSL "$PG_URL" -o postgresql.tar.gz
tar -xzf postgresql.tar.gz -C bundle
rm postgresql.tar.gz
- name: Download pgvector
shell: bash
run: |
PG_VERSION="${{ steps.versions.outputs.PG_VERSION }}"
PGVECTOR_COMPILED_TAG="${{ steps.versions.outputs.PGVECTOR_COMPILED_TAG }}"
PGVECTOR_COMPILED_REPO="${{ steps.versions.outputs.PGVECTOR_COMPILED_REPO }}"
PG_MAJOR=$(echo "$PG_VERSION" | cut -d. -f1)
PGVECTOR_URL="https://github.com/${PGVECTOR_COMPILED_REPO}/releases/download/${PGVECTOR_COMPILED_TAG}/pgvector-${{ matrix.pg_target }}-pg${PG_MAJOR}.tar.gz"
echo "Downloading pgvector from $PGVECTOR_URL"
curl -fsSL "$PGVECTOR_URL" -o pgvector.tar.gz
mkdir -p pgvector_extract
tar -xzf pgvector.tar.gz -C pgvector_extract
rm pgvector.tar.gz
# Find PostgreSQL directory in bundle
PG_DIR=$(find bundle -maxdepth 1 -type d | tail -1)
# Copy pgvector files
find pgvector_extract -name "*.so" -exec cp {} "$PG_DIR/lib/" \; 2>/dev/null || true
find pgvector_extract -name "*.dylib" -exec cp {} "$PG_DIR/lib/" \; 2>/dev/null || true
find pgvector_extract -name "*.dll" -exec cp {} "$PG_DIR/lib/" \; 2>/dev/null || true
find pgvector_extract -name "vector.control" -exec cp {} "$PG_DIR/share/extension/" \; 2>/dev/null || true
find pgvector_extract -name "vector--*.sql" -exec cp {} "$PG_DIR/share/extension/" \; 2>/dev/null || true
rm -rf pgvector_extract
echo "pgvector installed"
- name: Create bundle archive
shell: bash
run: |
PG_VERSION="${{ steps.versions.outputs.PG_VERSION }}"
cd bundle
tar -czf ../postgresql-${PG_VERSION}-${{ matrix.pg_target }}.tar.gz .
cd ..
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: postgresql-${{ matrix.name }}
path: postgresql-${{ steps.versions.outputs.PG_VERSION }}-${{ matrix.pg_target }}.tar.gz
release:
needs: [build-cli, build-postgres-bundle]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Load versions
id: versions
run: |
source versions.env
echo "PG_VERSION=$PG_VERSION" >> $GITHUB_OUTPUT
echo "PGVECTOR_VERSION=$PGVECTOR_VERSION" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release files
run: |
mkdir release
find artifacts -type f -exec mv {} release/ \;
ls -la release/
- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
PG_VERSION: ${{ steps.versions.outputs.PG_VERSION }}
PGVECTOR_VERSION: ${{ steps.versions.outputs.PGVECTOR_VERSION }}
run: |
echo "## Embedded PostgreSQL CLI" > release_notes.md
echo "" >> release_notes.md
echo "### CLI Binaries" >> release_notes.md
echo "- \`embedded-postgres-darwin-aarch64\` - macOS Apple Silicon" >> release_notes.md
echo "- \`embedded-postgres-linux-x86_64\` - Linux x86_64" >> release_notes.md
echo "- \`embedded-postgres-windows-x86_64.exe\` - Windows x64" >> release_notes.md
echo "" >> release_notes.md
echo "### PostgreSQL Bundles (with pgvector)" >> release_notes.md
echo "- PostgreSQL ${PG_VERSION} with pgvector ${PGVECTOR_VERSION}" >> release_notes.md
echo "" >> release_notes.md
echo "### Installation (macOS/Linux)" >> release_notes.md
echo "\`\`\`bash" >> release_notes.md
echo "curl -fsSL https://raw.githubusercontent.com/vectorize-io/embedded-pg-cli/main/install.sh | bash" >> release_notes.md
echo "\`\`\`" >> release_notes.md
gh release create "${{ github.ref_name }}" --title "${{ github.ref_name }}" --notes-file release_notes.md release/*