Skip to content

Merge branch 'main' into v1.13.x #396

Merge branch 'main' into v1.13.x

Merge branch 'main' into v1.13.x #396

Workflow file for this run

name: Build Draft Release
on:
push:
tags:
- 'v*'
env:
PROJECT_ID: steampipe
IMAGE_NAME: fdw
CORE_REPO: us-docker.pkg.dev/steampipe/steampipe
ORG: turbot
CONFIG_SCHEMA_VERSION: "2020-11-18"
VERSION: ${{ github.event.ref }}
jobs:
build-osx:
name: Build for Darwin x86_64
runs-on: macos-13
steps:
- name: Install PostgreSQL@14
run: brew install --force postgresql@14
- name: PGConfig
run: |-
which pg_config
ls -l $(which pg_config)
PGXS=$(pg_config --pgxs)
SERVER_LIB=$(pg_config --includedir)/server
INTERNAL_LIB=$(pg_config --includedir)/internal
echo $PGXS
echo $SERVER_LIB
echo $INTERNAL_LIB
ls -l $PGXS
ls -l $SERVER_LIB
ls -l $INTERNAL_LIB
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Golang
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version: 1.22
- name: Fetching Go Cache Paths
id: go-cache-paths
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Go Build Cache
id: build-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Go Mod Cache
id: mod-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: make clean
run: |-
go version
which pg_config
pg_config --version
export PATH=$(pg_config --bindir):$PATH
export PGXS=$(pg_config --pgxs)
export SERVER_LIB=$(pg_config --includedir)/server
export INTERNAL_LIB=$(pg_config --includedir)/internal
export CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export PG_CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export LDFLAGS=$(pg_config --ldfalgs)
export PG_LDFLAGS=$(pg_config --ldfalgs)
make clean
- name: make
run: |-
go version
which pg_config
pg_config --version
export PATH=$(pg_config --bindir):$PATH
export PGXS=$(pg_config --pgxs)
export SERVER_LIB=$(pg_config --includedir)/server
export INTERNAL_LIB=$(pg_config --includedir)/internal
export CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export PG_CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export LDFLAGS=$(pg_config --ldfalgs)
export PG_LDFLAGS=$(pg_config --ldfalgs)
make
- name: gzip the steampipe_postgres_fdw.so
run: |-
gzip build-Darwin/steampipe_postgres_fdw.so
mv build-Darwin/steampipe_postgres_fdw.so.gz build-Darwin/steampipe_postgres_fdw.so.darwin_amd64.gz
- name: Save MacOS Build Artifact - AMD64
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: steampipe_postgres_fdw.so.darwin_amd64
path: build-Darwin/steampipe_postgres_fdw.so.darwin_amd64.gz
if-no-files-found: error
- name: Save steampipe_postgres_fdw.control # only need this once for ALL platforms
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: steampipe_postgres_fdw.control
path: ./fdw/steampipe_postgres_fdw.control
if-no-files-found: error
- name: Save steampipe_postgres_fdw--1.0.sql # only need this once for ALL platforms
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: steampipe_postgres_fdw--1.0.sql
path: ./fdw/steampipe_postgres_fdw--1.0.sql
if-no-files-found: error
build-osx-arm:
name: Build for Darwin ARM64
runs-on: macos-latest
steps:
- name: Install PostgreSQL@14
run: brew install --force postgresql@14
- name: PGConfig
run: |-
which pg_config
ls -l $(which pg_config)
PGXS=$(pg_config --pgxs)
SERVER_LIB=$(pg_config --includedir)/server
INTERNAL_LIB=$(pg_config --includedir)/internal
echo $PGXS
echo $SERVER_LIB
echo $INTERNAL_LIB
ls -l $PGXS
ls -l $SERVER_LIB
ls -l $INTERNAL_LIB
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Golang
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version: 1.22
- name: Fetching Go Cache Paths
id: go-cache-paths
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Go Build Cache
id: build-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Go Mod Cache
id: mod-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: make clean
run: |-
go version
which pg_config
pg_config --version
export PATH=$(pg_config --bindir):$PATH
export PGXS=$(pg_config --pgxs)
export SERVER_LIB=$(pg_config --includedir)/server
export INTERNAL_LIB=$(pg_config --includedir)/internal
export CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export PG_CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export LDFLAGS=$(pg_config --ldfalgs)
export PG_LDFLAGS=$(pg_config --ldfalgs)
make clean
- name: make
run: |-
go version
which pg_config
pg_config --version
export PATH=$(pg_config --bindir):$PATH
export PGXS=$(pg_config --pgxs)
export SERVER_LIB=$(pg_config --includedir)/server
export INTERNAL_LIB=$(pg_config --includedir)/internal
export CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export PG_CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export LDFLAGS=$(pg_config --ldfalgs)
export PG_LDFLAGS=$(pg_config --ldfalgs)
make
- name: gzip the steampipe_postgres_fdw.so
run: |-
gzip build-Darwin/steampipe_postgres_fdw.so
mv build-Darwin/steampipe_postgres_fdw.so.gz build-Darwin/steampipe_postgres_fdw.so.darwin_arm64.gz
- name: Save MacOS Build Artifact - AMD64
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: steampipe_postgres_fdw.so.darwin_arm64
path: build-Darwin/steampipe_postgres_fdw.so.darwin_arm64.gz
if-no-files-found: error
build-linux:
name: Build for Linux x86_64
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup GoLang
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version: 1.22
- name: Fetching Go Cache Paths
id: go-cache-paths
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Go Build Cache
id: build-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Go Mod Cache
id: mod-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Setup apt-get
run: |-
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo env ACCEPT_EULA=Y apt-get update
sudo env ACCEPT_EULA=Y apt-get upgrade
- name: Install PostgreSQL14 Dev
run: |-
sudo apt-get -y install postgresql-server-dev-14
- name: Find stuff and set env
run: |-
which pg_config
pg_config --version
export PATH=$(pg_config --bindir):$PATH
export PGXS=$(pg_config --pgxs)
export SERVER_LIB=$(pg_config --includedir)/14/server
export INTERNAL_LIB=$(pg_config --includedir)/internal
export CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export PG_CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export LDFLAGS=$(pg_config --ldflags)
export PG_LDFLAGS=$(pg_config --ldflags)
ls -la $SERVER_LIB
ls -la $INTERNAL_LIB
- name: make clean
run: |-
go version
make clean
- name: make
run: |-
make
- name: gzip the steampipe_postgres_fdw.so
run: |-
gzip build-Linux/steampipe_postgres_fdw.so
mv build-Linux/steampipe_postgres_fdw.so.gz build-Linux/steampipe_postgres_fdw.so.linux_amd64.gz
- name: Save Linux Build Artifact - AMD64
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: steampipe_postgres_fdw.so.linux_amd64
path: build-Linux/steampipe_postgres_fdw.so.linux_amd64.gz
if-no-files-found: error
build-linux-arm:
name: Build for Linux ARM64
runs-on: ubuntu-22.04-arm
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup GoLang
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version: 1.22
- name: Fetching Go Cache Paths
id: go-cache-paths
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Go Build Cache
id: build-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Go Mod Cache
id: mod-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Setup apt-get
run: |-
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo env ACCEPT_EULA=Y apt-get update
sudo env ACCEPT_EULA=Y apt-get upgrade
- name: Install PostgreSQL14 Dev
run: |-
sudo apt-get -y install postgresql-server-dev-14
- name: Find stuff and set env
run: |-
which pg_config
pg_config --version
export PATH=$(pg_config --bindir):$PATH
export PGXS=$(pg_config --pgxs)
export SERVER_LIB=$(pg_config --includedir)/14/server
export INTERNAL_LIB=$(pg_config --includedir)/internal
export CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export PG_CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export LDFLAGS=$(pg_config --ldflags)
export PG_LDFLAGS=$(pg_config --ldflags)
ls -la $SERVER_LIB
ls -la $INTERNAL_LIB
- name: make clean
run: |-
go version
make clean
- name: make
run: |-
make
- name: gzip the steampipe_postgres_fdw.so
run: |-
gzip build-Linux/steampipe_postgres_fdw.so
mv build-Linux/steampipe_postgres_fdw.so.gz build-Linux/steampipe_postgres_fdw.so.linux_arm64.gz
- name: Save Linux Build Artifact - AMD64
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: steampipe_postgres_fdw.so.linux_arm64
path: build-Linux/steampipe_postgres_fdw.so.linux_arm64.gz
if-no-files-found: error
build-draft-release:
name: Build Draft Release
runs-on: ubuntu-latest
needs:
- build-linux
- build-linux-arm
- build-osx
- build-osx-arm
steps:
- name: Get latest version tag
run: |-
echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Validate Version String
run: |-
if [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.+)?$ ]]; then
echo "Version OK: $VERSION"
else
echo "Invalid version: $VERSION"
exit 1
fi
- name: Download steampipe_postgres_fdw.so - darwin_amd64
id: download_fdw_so_darwin_amd64
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: steampipe_postgres_fdw.so.darwin_amd64
- name: Download steampipe_postgres_fdw.so - darwin_arm64
id: download_fdw_so_darwin_arm64
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: steampipe_postgres_fdw.so.darwin_arm64
- name: Download steampipe_postgres_fdw.so - linux_amd64
id: download_fdw_so_linux_amd64
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: steampipe_postgres_fdw.so.linux_amd64
- name: Download steampipe_postgres_fdw.so - linux_arm64
id: download_fdw_so_linux_arm64
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: steampipe_postgres_fdw.so.linux_arm64
- name: Download steampipe_postgres_fdw.control
id: download_fdw_control
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: steampipe_postgres_fdw.control
- name: Download steampipe_postgres_fdw--1.0.sql
id: download_fdw_sql
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: steampipe_postgres_fdw--1.0.sql
- name: Check Path
run: |-
ls -la
- name: Create a draft release
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
id: create_draft_release
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
name: ${{ env.VERSION }}
tag_name: ${{ env.VERSION }}
repository: ${{ github.repository }}
files: |-
${{ steps.download_fdw_sql.outputs.download-path }}/steampipe_postgres_fdw--1.0.sql
${{ steps.download_fdw_control.outputs.download-path }}/steampipe_postgres_fdw.control
${{ steps.download_fdw_so_linux_amd64.outputs.download-path }}/steampipe_postgres_fdw.so.linux_amd64.gz
${{ steps.download_fdw_so_linux_arm64.outputs.download-path }}/steampipe_postgres_fdw.so.linux_arm64.gz
${{ steps.download_fdw_so_darwin_amd64.outputs.download-path }}/steampipe_postgres_fdw.so.darwin_amd64.gz
${{ steps.download_fdw_so_darwin_arm64.outputs.download-path }}/steampipe_postgres_fdw.so.darwin_arm64.gz