Skip to content

Commit 65df84e

Browse files
authored
build for 14 (#5)
1 parent 0370349 commit 65df84e

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

.github/workflows/ci.yaml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,47 @@ on:
1111
jobs:
1212
build:
1313
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
pg-version: [14]
1418
steps:
15-
- name: Get latest commit id of PostgreSQL 14
19+
- name: Add PG_VERSION to env
1620
run: |
17-
echo "PG_COMMIT_HASH=$(git ls-remote git://git.postgresql.org/git/postgresql.git refs/heads/REL_14_STABLE | awk '{print $1}')" >> $GITHUB_ENV
21+
echo "PG_VERSION=${{ matrix.pg-version }}" >> $GITHUB_ENV
22+
echo "PG_SRC_DIR=$HOME/pg${{ matrix.pg-version }}" >> $GITHUB_ENV
1823
19-
- name: Cache PostgreSQL 14
24+
- name: Get latest commit id of PostgreSQL ${{ env.PG_VERSION }}
25+
run: |
26+
echo "PG_COMMIT_HASH=$(git ls-remote git://git.postgresql.org/git/postgresql.git refs/heads/REL_${PG_VERSION}_STABLE | awk '{print $1}')" >> $GITHUB_ENV
27+
28+
- name: Cache PostgreSQL ${{ env.PG_VERSION }}
2029
uses: actions/cache@v3
21-
id: pg14cache
30+
id: pg-source-cache
2231
with:
23-
path: ~/pg14
24-
key: ${{ runner.os }}-v1-pg14-${{ env.PG_COMMIT_HASH }}
32+
path: ${{ env.PG_SRC_DIR }}
33+
key: ${{ runner.os }}-v2-pg-${{ env.PG_COMMIT_HASH }}
2534

26-
- name: Install PostgreSQL 14
27-
if: steps.pg14cache.outputs.cache-hit != 'true'
35+
- name: Install PostgreSQL ${{ env.PG_VERSION }}
36+
if: steps.pg-source-cache.outputs.cache-hit != 'true'
2837
run: |
29-
git clone --depth 1 --branch REL_14_STABLE git://git.postgresql.org/git/postgresql.git ~/pg14source
30-
cd ~/pg14source
31-
./configure --prefix=$HOME/pg14 CFLAGS="-std=gnu99 -ggdb -O0" --enable-cassert
38+
git clone --depth 1 --branch REL_${PG_VERSION}_STABLE git://git.postgresql.org/git/postgresql.git $PG_SRC_DIR
39+
cd $PG_SRC_DIR
40+
./configure --prefix=$PG_SRC_DIR CFLAGS="-std=gnu99 -ggdb -O0" --enable-cassert
3241
make install -j$(nproc) > /dev/null
3342
3443
- uses: actions/checkout@v3
3544

3645
- name: Build
3746
id: build
3847
run: |
39-
make PG_CONFIG=$HOME/pg14/bin/pg_config install -j$(nproc)
48+
make PG_CONFIG=$PG_SRC_DIR/bin/pg_config install -j$(nproc)
4049
4150
- name: Package Extension
4251
id: package
4352
run: |
4453
npm install
45-
npm run main -- --pgVersion 14
54+
npm run main -- --pgVersion $PG_VERSION
4655
working-directory: ${{ github.workspace }}/packaging
4756

4857
- name: Upload Release Asset

packaging/index.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ console.log(`Temporary working directory: ${tmpDir}`)
2121

2222
// within the temporary working directory, we create a directory called
2323
// 'postgresql-$pgVersion-peerdb'
24-
let pgDir = `${tmpDir}/postgresql-${pgVersion}-peerdb`
24+
let extName = `postgresql-${pgVersion}-peerdb-fdw`
25+
let pgDir = `${tmpDir}/${extName}`
2526
await $`mkdir ${pgDir}`
2627
cd(pgDir)
2728

@@ -48,7 +49,7 @@ await $`mkdir ${debFolder}`
4849
// create the control file
4950
let controlFile = `${debFolder}/control`
5051
await $`touch ${controlFile}`
51-
await $`echo "Package: postgresql-${pgVersion}-peerdb" >> ${controlFile}`
52+
await $`echo "Package: ${extName}" >> ${controlFile}`
5253
await $`echo "Version: 1.2" >> ${controlFile}`
5354
await $`echo "Section: base" >> ${controlFile}`
5455
await $`echo "Priority: optional" >> ${controlFile}`

0 commit comments

Comments
 (0)