Skip to content

Commit c9203f1

Browse files
authored
fix(ci): auto-derive PGXN version from git tag (#50)
* fix(ci): auto-derive PGXN version from git tag META.json version was hardcoded at 0.1.7 and never updated, causing the v0.3.1 PGXN release to fail with "already exists". Update to 0.3.1 and add a workflow step that rewrites META.json version from the git tag before bundling, so future releases don't need manual bumps. * chore: bump META.json version to 0.3.2 for next release
1 parent 52acef0 commit c9203f1

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/pgxn.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ jobs:
1010
- name: Check out the repo
1111
uses: actions/checkout@v4
1212
with: { submodules: recursive, fetch-depth: 0 }
13+
- name: Set version from tag
14+
if: startsWith( github.ref, 'refs/tags/v' )
15+
run: |
16+
VERSION="${GITHUB_REF#refs/tags/v}"
17+
jq --arg v "$VERSION" '.version = $v | .provides.pg_stat_ch.version = $v' META.json > META.tmp
18+
mv META.tmp META.json
1319
- name: Bundle the Release
1420
env: { GIT_ARCHIVE_CMD: archive-all }
1521
id: bundle

META.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"abstract": "PostgreSQL Query Telemetry Exporter to ClickHouse",
2828
"docfile": "README.md",
2929
"file": "pg_stat_ch.control",
30-
"version": "0.1.7"
30+
"version": "0.3.2"
3131
}
3232
},
3333
"resources": {
@@ -46,5 +46,5 @@
4646
"metrics",
4747
"clickhouse"
4848
],
49-
"version": "0.1.7"
49+
"version": "0.3.2"
5050
}

0 commit comments

Comments
 (0)