From 6dcf6b6193e3a7aa7da42fc0e1172df7582b57b6 Mon Sep 17 00:00:00 2001 From: Ihor Kalnytskyi Date: Tue, 22 Oct 2024 22:35:10 +0300 Subject: [PATCH] Add PostgreSQL 17 PostgreSQL 17 is the most recent version of the PostgreSQL database, released on September 26, 2024. It just makes sense to keep up with the upstream versions if we can, hence this patch. --- .github/workflows/ci.yml | 3 ++- README.md | 2 +- action.yml | 13 +++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9003c67..9f2ab14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: CERTIFICATE_PATH: ${{ steps.postgres.outputs.certificate-path }} EXPECTED_CONNECTION_URI: postgresql://postgres:postgres@localhost:5432/postgres EXPECTED_SERVICE_NAME: postgres - EXPECTED_SERVER_VERSION: "16" + EXPECTED_SERVER_VERSION: "17" EXPECTED_SSL: false parametrized: @@ -67,6 +67,7 @@ jobs: postgres-version: - "14" - "15" + - "16" steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index cbcd2af..e3955ae 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ key features: | password | The password of the user to setup. | `postgres` | | database | The database name to setup and grant permissions to created user. | `postgres` | | port | The server port to listen on. | `5432` | -| postgres-version | The PostgreSQL major version to install. Supported values: "14", "15", "16". | `16` | +| postgres-version | The PostgreSQL major version to install. Supported values: "14", "15", "16", "17". | `17` | #### Outputs diff --git a/action.yml b/action.yml index 7a824f0..a622561 100644 --- a/action.yml +++ b/action.yml @@ -22,8 +22,8 @@ inputs: default: "5432" required: false postgres-version: - description: The PostgreSQL major version to install. Either "14", "15", or "16". - default: "16" + description: The PostgreSQL major version to install. Either "14", "15", "16" or "17". + default: "17" ssl: description: When "true", encrypt connections using SSL (TLS). default: "false" @@ -43,8 +43,8 @@ runs: steps: - name: Install PostgreSQL run: | - if [[ ! "${{ inputs.postgres-version }}" =~ ^(14|15|16)$ ]]; then - echo "::error::postgres-version must be one of: 14, 15, 16." + if [[ ! "${{ inputs.postgres-version }}" =~ ^(14|15|16|17)$ ]]; then + echo "::error::postgres-version must be one of: 14, 15, 16, 17." exit 1 fi @@ -82,6 +82,11 @@ runs: echo "PQ_LIB_DIR=$PG_LIBDIR" >> $GITHUB_ENV elif [ "$RUNNER_OS" == "macOS" ]; then + if [[ "${{ inputs.postgres-version }}" == "17" && "$(sw_vers -productVersion)" =~ 12.* ]]; then + echo "::error::PostgreSQL 17 is not supported on macOS 12 (Monterey). Use PostgreSQL 16 or macOS 13 (Ventura)." + exit 1 + fi + export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 export HOMEBREW_NO_INSTALL_CLEANUP=1 export HOMEBREW_NO_INSTALL_UPGRADE=1