name: Build and Release Binaries
on:
push:
tags:
- 'v*.*.*' workflow_dispatch:
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y patchelf
- name: Build Standard PostgreSQL Binaries (x86_64)
run: |
chmod +x ./scripts/extract-pg-from-docker.sh
PLATFORM="linux/amd64" PG_MAJORS="18 17" ENGINE=postgresql ./scripts/extract-pg-from-docker.sh
- name: Build Without-LLVM PostgreSQL Binaries (x86_64)
run: |
PLATFORM="linux/amd64" PG_MAJORS="18 17" ENGINE=postgresql-without-llvm ./scripts/extract-pg-from-docker.sh
- name: Build Spock PostgreSQL Binaries (x86_64)
run: |
PLATFORM="linux/amd64" PG_MAJORS="18 17" ENGINE=spock ./scripts/extract-pg-from-docker.sh
- name: Build PgVector PostgreSQL Binaries (x86_64)
run: |
PLATFORM="linux/amd64" PG_MAJORS="18 17" ENGINE=postgresql-pgvector ./scripts/extract-pg-from-docker.sh
- name: Build Standard PostgreSQL Binaries (aarch64)
run: |
PLATFORM="linux/arm64" PG_MAJORS="18 17" ENGINE=postgresql ./scripts/extract-pg-from-docker.sh
- name: Build Without-LLVM PostgreSQL Binaries (aarch64)
run: |
PLATFORM="linux/arm64" PG_MAJORS="18 17" ENGINE=postgresql-without-llvm ./scripts/extract-pg-from-docker.sh
- name: Build Spock PostgreSQL Binaries (aarch64)
run: |
PLATFORM="linux/arm64" PG_MAJORS="18 17" ENGINE=spock ./scripts/extract-pg-from-docker.sh
- name: Build PgVector PostgreSQL Binaries (aarch64)
run: |
PLATFORM="linux/arm64" PG_MAJORS="18 17" ENGINE=postgresql-pgvector ./scripts/extract-pg-from-docker.sh
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu
- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build postg CLI (x86_64)
run: |
cargo build --release --target x86_64-unknown-linux-gnu
cp target/x86_64-unknown-linux-gnu/release/postg ./postg
tar -czf postg-${{ github.ref_name }}-x86_64-linux.tar.gz postg
rm postg
- name: Build postg CLI (aarch64)
run: |
cross build --release --target aarch64-unknown-linux-gnu
cp target/aarch64-unknown-linux-gnu/release/postg ./postg
tar -czf postg-${{ github.ref_name }}-aarch64-linux.tar.gz postg
rm postg
- name: Upload Binaries to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/*.tar.gz
postg-${{ github.ref_name }}-x86_64-linux.tar.gz
postg-${{ github.ref_name }}-aarch64-linux.tar.gz
generate_release_notes: true