Skip to content

Commit

Permalink
feat: support pg15 & pg16 releases at the same time
Browse files Browse the repository at this point in the history
Signed-off-by: vados <[email protected]>
  • Loading branch information
t3hmrman committed Dec 18, 2023
1 parent 5685ac5 commit 99a143f
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 9 deletions.
38 changes: 30 additions & 8 deletions .github/workflows/build-and-test-gnu/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ inputs:
user:
type: string
default: idkit
pgrx-version:
type: string
default: pg16
decription: |
PGRX version (ex. 'pg15', 'pg16')
pg-version:
type: string
default: 16.1
decription: |
Postgres version (ex. '15.5, '16.1')
outputs: {}
runs:
using: "composite"
Expand Down Expand Up @@ -106,14 +116,16 @@ runs:
if: ${{ inputs.artifact-upload }}
shell: bash
env:
CARGO_HOME: ${{ inputs.cargo-home-dir }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
CARGO_BUILD_RUSTC_WRAPPER: ${{ inputs.cargo-build-rustc-wrapper }}
CARGO_HOME: ${{ inputs.cargo-home-dir }}
CARGO_INCREMENTAL: ${{ inputs.cargo-env-incrmental }}
CARGO_PROFILE: ${{ inputs.cargo-profile }}
USER: ${{ inputs.user }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PGRX_PKG_PATH_PREFIX: ${{ inputs.cargo-target-dir }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
USER: ${{ inputs.user }}
run: |
su idkit -c "cargo install --force cargo-get cargo-edit"
Expand All @@ -130,7 +142,9 @@ runs:
CARGO_INCREMENTAL: ${{ inputs.cargo-env-incrmental }}
CARGO_PROFILE: ${{ inputs.cargo-profile }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PGRX_PKG_PATH_PREFIX: ${{ inputs.cargo-target-dir }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
USER: ${{ inputs.user }}
run: |
Expand All @@ -145,7 +159,9 @@ runs:
CARGO_INCREMENTAL: ${{ inputs.cargo-env-incrmental }}
CARGO_PROFILE: ${{ inputs.cargo-profile }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PGRX_PKG_PATH_PREFIX: ${{ inputs.cargo-target-dir }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
USER: ${{ inputs.user }}
run: |
Expand All @@ -160,7 +176,9 @@ runs:
CARGO_INCREMENTAL: ${{ inputs.cargo-env-incrmental }}
CARGO_PROFILE: ${{ inputs.cargo-profile }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PGRX_PKG_PATH_PREFIX: ${{ inputs.cargo-target-dir }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
USER: ${{ inputs.user }}
run: |
Expand All @@ -170,12 +188,14 @@ runs:
- name: Run cargo test
shell: bash
env:
CARGO_HOME: ${{ inputs.cargo-home-dir }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
CARGO_BUILD_RUSTC_WRAPPER: ${{ inputs.cargo-build-rustc-wrapper }}
CARGO_HOME: ${{ inputs.cargo-home-dir }}
CARGO_INCREMENTAL: ${{ inputs.cargo-env-incrmental }}
CARGO_PROFILE: ${{ inputs.cargo-profile }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
USER: ${{ inputs.user }}
run: |
su idkit -c "cargo test"
Expand All @@ -194,10 +214,12 @@ runs:
CARGO_INCREMENTAL: ${{ inputs.cargo-env-incrmental }}
CARGO_PROFILE: ${{ inputs.cargo-profile }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PGRX_PKG_PATH_PREFIX: ${{ inputs.cargo-target-dir }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
PKG_TARBALL_SUFFIX: ${{ inputs.artifact-tarball-suffix }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
USER: ${{ inputs.user }}
PKG_TARBALL_SUFFIX: ${{ inputs.artifact-tarball-suffix }}
run: |
su idkit -c "just package"
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/build-rpm/action.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build-rpm
name: build-rpm
description: Build an RPM for pg_idkit
inputs:
artifact-upload:
Expand All @@ -24,6 +24,11 @@ inputs:
default: pg16
decription: |
PGRX version (ex. 'pg15', 'pg16')
pg-version:
type: string
default: 16.1
decription: |
Postgres version (ex. '15.5, '16.1')
outputs: {}
runs:
using: "composite"
Expand Down Expand Up @@ -52,6 +57,9 @@ runs:
- name: Build RPM
shell: bash
env:
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
run: just package build-rpm

- name: Get RPM output path
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,42 @@ on:
jobs:
build-rpm:
runs-on: ubuntu-latest
strategy:
matrix:
config:
- pgrx:
version: pg15
pg:
version: 15.5
- pgrx:
version: pg16
pg:
version: 16.1
steps:
- uses: actions/checkout@v3

- name: Build the RPM (reuse workflow)
uses: ./.github/workflows/build-rpm
with:
artifact-upload: true
pgrx-version: ${{ matrix.config.pgrx.version }}
pg-version: ${{ matrix.config.pg.version }}

build-zip-gnu:
runs-on: ubuntu-latest
container:
image: ghcr.io/vadosware/pg_idkit/builder-gnu:0.1.x
strategy:
matrix:
config:
- pgrx:
version: pg15
pg:
version: 15.5
- pgrx:
version: pg16
pg:
version: 16.1
steps:
- uses: actions/checkout@v3

Expand All @@ -32,6 +56,8 @@ jobs:
with:
artifact-upload: true
artifact-tarball-suffix: "-gnu"
pgrx-version: ${{ matrix.config.pgrx.version }}
pg-version: ${{ matrix.config.pg.version }}

release:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 99a143f

Please sign in to comment.