From 5d054e7de009c46b343f0a7431c8398fafb04baa Mon Sep 17 00:00:00 2001 From: Vlad Arkhipov Date: Fri, 31 Mar 2023 09:33:06 +0300 Subject: [PATCH] Add PGXN extension build. --- .gitattributes | 3 ++ .github/workflows/build-pgxn-extension.yml | 32 ++++++++++++++++++++++ .github/workflows/build-win.yml | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 .github/workflows/build-pgxn-extension.yml diff --git a/.gitattributes b/.gitattributes index c96607b..87a9f81 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,4 @@ *.vcxproj text eol=crlf +*.sln export-ignore +*.vcx* export-ignore +.* export-ignore diff --git a/.github/workflows/build-pgxn-extension.yml b/.github/workflows/build-pgxn-extension.yml new file mode 100644 index 0000000..e813d5c --- /dev/null +++ b/.github/workflows/build-pgxn-extension.yml @@ -0,0 +1,32 @@ +name: Build PGXN Extension + +on: + push: + tags: + - '*' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Package extension + id: package + run: | + extension_name=$(grep -m 1 '"name":' META.json | sed -e 's/[[:space:]]*"name":[[:space:]]*"\([^"]*\)",/\1/') + extension_version=$(grep -m 1 '[[:space:]]\{8\}"version":' META.json | sed -e 's/[[:space:]]*"version":[[:space:]]*"\([^"]*\)",\{0,1\}/\1/') + + echo "extension_name=$extension_name" >> $GITHUB_OUTPUT + echo "extension_version=$extension_version" >> $GITHUB_OUTPUT + + git archive --format zip --prefix=$extension_name-$extension_version/ -o $extension_name-$extension_version.zip HEAD + + - name: Deploy Artifacts + uses: softprops/action-gh-release@v1 + with: + fail_on_unmatched_files: true + files: | + ${{ steps.package.outputs.extension_name }}-${{ steps.package.outputs.extension_version }}.zip diff --git a/.github/workflows/build-win.yml b/.github/workflows/build-win.yml index 8ecb6e5..574886e 100644 --- a/.github/workflows/build-win.yml +++ b/.github/workflows/build-win.yml @@ -108,6 +108,7 @@ jobs: } else { & "$env:PG_ROOT\bin\pg_regress.exe" "$env:PSQL_OPT=$env:PG_ROOT\bin" --dbname=pl_regression install acl_oid acl_uuid acl_int8 acl_int4 2>&1 | Out-Default } + if ($LASTEXITCODE -ne 0) { Get-Content -Path ".\regression.diffs" | Out-Printer Write-Error "Tests failed" @@ -135,5 +136,6 @@ jobs: uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: + fail_on_unmatched_files: true files: | acl-pg${{ env.PG_VERSION }}-${{ matrix.platform }}.zip