From 99a143f41466fd5db91b072ad60ae5f3024acf5d Mon Sep 17 00:00:00 2001 From: vados Date: Mon, 18 Dec 2023 19:53:32 +0900 Subject: [PATCH] feat: support pg15 & pg16 releases at the same time Signed-off-by: vados --- .../workflows/build-and-test-gnu/action.yaml | 38 +++++++++++++++---- .github/workflows/build-rpm/action.yaml | 10 ++++- .github/workflows/release.yaml | 26 +++++++++++++ 3 files changed, 65 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-test-gnu/action.yaml b/.github/workflows/build-and-test-gnu/action.yaml index 242fded..66a8147 100644 --- a/.github/workflows/build-and-test-gnu/action.yaml +++ b/.github/workflows/build-and-test-gnu/action.yaml @@ -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" @@ -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" @@ -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: | @@ -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: | @@ -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: | @@ -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" @@ -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" diff --git a/.github/workflows/build-rpm/action.yaml b/.github/workflows/build-rpm/action.yaml index 70a1488..79e24e0 100644 --- a/.github/workflows/build-rpm/action.yaml +++ b/.github/workflows/build-rpm/action.yaml @@ -1,4 +1,4 @@ -name: build-rpm +name: build-rpm description: Build an RPM for pg_idkit inputs: artifact-upload: @@ -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" @@ -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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 56765d9..3bc643c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,6 +12,17 @@ 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 @@ -19,11 +30,24 @@ jobs: 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 @@ -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