From dc44dca3b28ecc08d0b2ba090b98acebbd353f55 Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Thu, 18 Jan 2024 11:39:43 -0500 Subject: [PATCH] Add PGXN release workflow --- .gitattributes | 4 +++ .github/workflows/pgxn-release.yml | 20 +++++++++++++ .gitignore | 1 + META.json | 46 ++++++++++++++++++++++++++++++ Makefile | 12 +++++++- README.md | 1 + 6 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/pgxn-release.yml create mode 100644 META.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d1a12b2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +.gitignore export-ignore +.gitattributes export-ignore +.github export-ignore +*.bak export-ignore diff --git a/.github/workflows/pgxn-release.yml b/.github/workflows/pgxn-release.yml new file mode 100644 index 0000000..826a998 --- /dev/null +++ b/.github/workflows/pgxn-release.yml @@ -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 diff --git a/.gitignore b/.gitignore index 98df7ab..52144ee 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ **/*.rs.bk .env .trunk +*.bak diff --git a/META.json b/META.json new file mode 100644 index 0000000..2c7e504 --- /dev/null +++ b/META.json @@ -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 " + ], + "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" + ] +} diff --git a/Makefile b/Makefile index e8be833..3e7149f 100644 --- a/Makefile +++ b/Makefile @@ -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 \ No newline at end of file + 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 diff --git a/README.md b/README.md index ffb5c4f..386dd51 100644 --- a/README.md +++ b/README.md @@ -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