Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PGXN release workflow
Browse files Browse the repository at this point in the history
theory committed Jan 24, 2024

Verified

This commit was signed with the committer’s verified signature.
theory David E. Wheeler
1 parent c394f0b commit 2aa4b71
Showing 6 changed files with 93 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.gitignore export-ignore
.gitattributes export-ignore
.github export-ignore
META.json.in export-ignore
21 changes: 21 additions & 0 deletions .github/workflows/pgxn-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 🚀 Release on PGXN
on:
push:
# Release on semantic version tag.
# tags: ['v[0-9]+.[0-9]+.[0-9]+']
jobs:
release:
name: Release on PGXN
runs-on: ubuntu-latest
container: pgxn/pgxn-tools
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Bundle the Release
env: { GIT_BUNDLE_OPTS: --add-file META.json }
run: make META.json && pgxn-bundle
- name: Release on PGXN
env:
PGXN_USERNAME: ${{ secrets.PGXN_USERNAME }}
PGXN_PASSWORD: ${{ secrets.PGXN_PASSWORD }}
run: ls -lah *.zip # pgxn-release
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -3,3 +3,5 @@
/target
*.iml
**/*.rs.bk
META.json
/orb_fdw-*
45 changes: 45 additions & 0 deletions META.json.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "orb_fdw",
"abstract": "A foreign data wrapper for Orb",
"description": "Vectorize automates that the transformation and orchestration of text to embeddings, allowing you to do vector and semantic search on existing data with as little as two function calls.",
"version": "@CARGO_VERSION@",
"maintainer": [
"Tembo <[email protected]>"
],
"license": "postgresql",
"provides": {
"orb_fdw": {
"abstract": "A foreign data wrapper for Orb",
"file": "src/lib.rs",
"docfile": "README.md",
"version": "@CARGO_VERSION@"
}
},
"prereqs": {
"runtime": {
"requires": {
"PostgreSQL": "15.0.0"
}
}
},
"resources": {
"bugtracker": {
"web": "https://github.com/tembo-io/orb_fdw/issues/"
},
"repository": {
"url": "git://github.com/tembo-io/orb_fdw.git",
"web": "https://github.com/tembo-io/orb_fdw/",
"type": "git"
}
},
"generated_by": "David E. Wheeler",
"meta-spec": {
"version": "1.0.0",
"url": "https://pgxn.org/meta/spec.txt"
},
"tags": [
"fdw",
"foreign data wrapper",
"orb"
]
}
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
PGRX_POSTGRES ?= pg15
DISTNAME = $(shell grep -m 1 '^name' Trunk.toml | sed -e 's/[^"]*"\([^"]*\)",\{0,1\}/\1/')
DISTVERSION = $(shell grep -m 1 '^version' Trunk.toml | sed -e 's/[^"]*"\([^"]*\)",\{0,1\}/\1/')

META.json: META.json.in Cargo.toml
@sed "s/@CARGO_VERSION@/$(DISTVERSION)/g" $< > $@

$(DISTNAME)-$(DISTVERSION).zip: META.json
git archive --format zip --prefix $(DISTNAME)-$(DISTVERSION)/ --add-file $< -o $(DISTNAME)-$(DISTVERSION).zip HEAD

pgxn-zip: $(DISTNAME)-$(DISTVERSION).zip

clean:
@rm -rf META.json $(DISTNAME)-$(DISTVERSION).zip
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,21 +2,24 @@

This is a simple open-source data wrapper that bridges the gap between your Postgres database and [Orb](https://www.withorb.com/) a leading usage-based billing solution.

[![Static Badge](https://img.shields.io/badge/%40tembo-community?logo=slack&label=slack)](https://join.slack.com/t/tembocommunity/shared_invite/zt-20dtnhcmo-pLNV7_Aobi50TdTLpfQ~EQ)
[![PGXN version](https://badge.fury.io/pg/orb_fdw.svg)](https://pgxn.org/dist/orb_fdw/)

### Pre-requisistes

- have the v0.0.1 of `orb_fdw` extension enabled in your instance

Create the foreign data wrapper:

```
``` sql
create foreign data wrapper orb_wrapper
handler orb_fdw_handler
validator orb_fdw_validator;
```

Connect to clerk using your credentials:

```
``` sql
create server my_orb_server
foreign data wrapper orb_wrapper
options (
@@ -29,7 +32,7 @@ Create Foreign Table:

This table will store information about the users.

```
``` sql
create foreign table orb_customers (
user_id text,
organization_id text,
@@ -48,7 +51,7 @@ create foreign table orb_customers (

This table will store information about the subscriptions.

```
``` sql
create foreign table orb_subscriptions (
subscription_id text,
organization_id text,

0 comments on commit 2aa4b71

Please sign in to comment.