Skip to content

Commit

Permalink
Add PGXN release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Jan 18, 2024
1 parent 87ad305 commit dc44dca
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 1 deletion.
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
*.bak export-ignore
20 changes: 20 additions & 0 deletions .github/workflows/pgxn-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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
run: make META.json.bak && pgxn-bundle
- name: Release on PGXN
env:
PGXN_USERNAME: ${{ secrets.PGXN_USERNAME }}
PGXN_PASSWORD: ${{ secrets.PGXN_PASSWORD }}
run: pgxn-release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
**/*.rs.bk
.env
.trunk
*.bak
46 changes: 46 additions & 0 deletions META.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "pg_later",
"abstract": "Run queries now and get results later",
"description": "A postgres extension to execute queries asynchronously built on pgmq",
"version": "@CARGO_VERSION@",
"maintainer": [
"Tembo <[email protected]>"
],
"license": "postgresql",
"provides": {
"pgmq": {
"abstract": "Run queries now and get results later",
"file": "src/lib.rs",
"docfile": "README.md",
"version": "@CARGO_VERSION@"
}
},
"prereqs": {
"runtime": {
"requires": {
"PostgreSQL": "11.0.0",
"pgmq": "0.25.0"
}
}
},
"resources": {
"bugtracker": {
"web": "https://github.com/tembo-io/pg_later/issues/"
},
"repository": {
"url": "git://github.com/tembo-io/pg_later.git",
"web": "https://github.com/tembo-io/pg_later/",
"type": "git"
}
},
"generated_by": "David E. Wheeler",
"meta-spec": {
"version": "1.0.0",
"url": "https://pgxn.org/meta/spec.txt"
},
"tags": [
"pgmq",
"later",
"async"
]
}
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# DISTVERSION = $(shell grep -m 1 '^version' Cargo.toml | sed -e 's/[^"]*"\([^"]*\)",\{0,1\}/\1/')
DISTVERSION = 0.0.12

format:
cargo fmt --all
cargo clippy

# run in pgrx locally
run:
PGLATER_SOCKET_URL='postgresql:///pg_later?host=/Users/${USER}/.pgrx&user=${USER}&dbname=pg_later&port=28815' cargo pgrx run
PGLATER_SOCKET_URL='postgresql:///pg_later?host=/Users/${USER}/.pgrx&user=${USER}&dbname=pg_later&port=28815' cargo pgrx run

META.json.bak: Cargo.toml META.json
@sed -i.bak "s/@CARGO_VERSION@/$(DISTVERSION)/g" META.json

pgxn-zip: META.json.bak
git archive --format zip --prefix=pg_later-$(DISTVERSION)/ -o pg_later-$(DISTVERSION).zip HEAD
@mv META.json.bak META.json
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Execute SQL now and get the results later.
A postgres extension to execute queries asynchronously. Built on [pgmq](https://github.com/tembo-io/pgmq).

[![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/pg_later.svg)](https://pgxn.org/dist/pg_later/)

## Installation

Expand Down

0 comments on commit dc44dca

Please sign in to comment.