Skip to content

Commit

Permalink
build for 14 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik authored Apr 15, 2023
1 parent 0370349 commit 65df84e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,47 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pg-version: [14]
steps:
- name: Get latest commit id of PostgreSQL 14
- name: Add PG_VERSION to env
run: |
echo "PG_COMMIT_HASH=$(git ls-remote git://git.postgresql.org/git/postgresql.git refs/heads/REL_14_STABLE | awk '{print $1}')" >> $GITHUB_ENV
echo "PG_VERSION=${{ matrix.pg-version }}" >> $GITHUB_ENV
echo "PG_SRC_DIR=$HOME/pg${{ matrix.pg-version }}" >> $GITHUB_ENV
- name: Cache PostgreSQL 14
- name: Get latest commit id of PostgreSQL ${{ env.PG_VERSION }}
run: |
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
- name: Cache PostgreSQL ${{ env.PG_VERSION }}
uses: actions/cache@v3
id: pg14cache
id: pg-source-cache
with:
path: ~/pg14
key: ${{ runner.os }}-v1-pg14-${{ env.PG_COMMIT_HASH }}
path: ${{ env.PG_SRC_DIR }}
key: ${{ runner.os }}-v2-pg-${{ env.PG_COMMIT_HASH }}

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

- name: Build
id: build
run: |
make PG_CONFIG=$HOME/pg14/bin/pg_config install -j$(nproc)
make PG_CONFIG=$PG_SRC_DIR/bin/pg_config install -j$(nproc)
- name: Package Extension
id: package
run: |
npm install
npm run main -- --pgVersion 14
npm run main -- --pgVersion $PG_VERSION
working-directory: ${{ github.workspace }}/packaging

- name: Upload Release Asset
Expand Down
5 changes: 3 additions & 2 deletions packaging/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ console.log(`Temporary working directory: ${tmpDir}`)

// within the temporary working directory, we create a directory called
// 'postgresql-$pgVersion-peerdb'
let pgDir = `${tmpDir}/postgresql-${pgVersion}-peerdb`
let extName = `postgresql-${pgVersion}-peerdb-fdw`
let pgDir = `${tmpDir}/${extName}`
await $`mkdir ${pgDir}`
cd(pgDir)

Expand All @@ -48,7 +49,7 @@ await $`mkdir ${debFolder}`
// create the control file
let controlFile = `${debFolder}/control`
await $`touch ${controlFile}`
await $`echo "Package: postgresql-${pgVersion}-peerdb" >> ${controlFile}`
await $`echo "Package: ${extName}" >> ${controlFile}`
await $`echo "Version: 1.2" >> ${controlFile}`
await $`echo "Section: base" >> ${controlFile}`
await $`echo "Priority: optional" >> ${controlFile}`
Expand Down

0 comments on commit 65df84e

Please sign in to comment.