From ce9e55322b054879c56d9a8e6d3aaed53a90a081 Mon Sep 17 00:00:00 2001 From: Puskar Basu <45908484+pskrbasu@users.noreply.github.com> Date: Fri, 19 Apr 2024 16:02:21 +0530 Subject: [PATCH] Update steampipe anywhere workflow to use steampipe-anywhere-aws workflow in the steampipe-workflows repository (#2171) --- .github/workflows/steampipe-anywhere.yml | 1052 +--------------------- 1 file changed, 4 insertions(+), 1048 deletions(-) diff --git a/.github/workflows/steampipe-anywhere.yml b/.github/workflows/steampipe-anywhere.yml index b588dec25..78480edc8 100644 --- a/.github/workflows/steampipe-anywhere.yml +++ b/.github/workflows/steampipe-anywhere.yml @@ -10,1052 +10,8 @@ on: version: description: "The version to release (must be prefixed with 'v')" required: true - -jobs: - build-postgres-14-fdw-linux-amd64: - name: Build Postgres 14 FDW for Linux - AMD64 - runs-on: ubuntu-20.04 - - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Check out steampipe-postgres-fdw - uses: actions/checkout@v2 - with: - repository: "turbot/steampipe-postgres-fdw" - ref: main - - - name: Setup GoLang - uses: actions/setup-go@v4 - with: - go-version: 1.21 - - - 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: Build steampipe-postgres-fdw-anywhere - run: | - pwd - ls -ltr - make standalone plugin=${{ env.PLUGIN_NAME }} - ls -ltr - - - name: Rename and zip the build-Linux folder - run: |- - mv build-Linux steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_amd64 - tar -czvf steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_amd64.tar.gz steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_amd64 - - - name: Save Linux Build Artifact - AMD64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_amd64.tar.gz - path: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_amd64.tar.gz - if-no-files-found: error - - build-postgres-14-fdw-linux-arm64: - name: Build Postgres 14 FDW for Linux - ARM64 - runs-on: - group: steampipe-darwin-arm-runners - - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Check out steampipe-postgres-fdw-anywhere - uses: actions/checkout@v3 - with: - repository: "turbot/steampipe-postgres-fdw" - ref: main - - - name: Check docker images available in runner - run: docker images - - - name: Run build script - run: | - chmod +x ./scripts/build-linux-arm-pg14.sh - bash ./scripts/build-linux-arm-pg14.sh ${{ env.PLUGIN_NAME }} - - - name: Check if binaries are available - run: ls -l $GITHUB_WORKSPACE - - - name: Save Linux Build Artifact - AMD64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_arm64.tar.gz - path: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_arm64.tar.gz - if-no-files-found: error - - build-postgres-14-fdw-osx-amd64: - name: Build Postgres 14 FDW for Darwin - AMD64 - runs-on: macos-latest - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Install PostgreSQL@14 - run: brew install 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: Check out steampipe-postgres-fdw - uses: actions/checkout@v2 - with: - repository: "turbot/steampipe-postgres-fdw" - ref: main - - - name: Setup Golang - uses: actions/setup-go@v4 - with: - go-version: 1.21 - - - name: Find stuff and set env - 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) - - - name: Build steampipe-postgres-fdw-anywhere - run: | - pwd - ls -ltr - make standalone plugin=${{ env.PLUGIN_NAME }} - ls -ltr - - - name: Rename and zip the build-Darwin folder - run: |- - mv build-Darwin steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_amd64 - tar -czvf steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_amd64.tar.gz steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_amd64 - - - name: Save MacOS Build Artifact - AMD64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_amd64.tar.gz - path: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_amd64.tar.gz - if-no-files-found: error - - build-postgres-14-fdw-osx-arm64: - name: Build Postgres 14 FDW for Darwin - ARM64 - runs-on: macos-14 - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Check architecture - run: uname -a - - - name: Install PostgreSQL@14 - run: brew install 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: Check out steampipe-postgres-fdw - uses: actions/checkout@v2 - with: - repository: "turbot/steampipe-postgres-fdw" - ref: main - - - name: Setup Golang - uses: actions/setup-go@v4 - with: - go-version: 1.21 - - - name: Find stuff and set env - 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) - - - name: Build steampipe-postgres-fdw-anywhere - run: | - pwd - ls -ltr - make standalone plugin=${{ env.PLUGIN_NAME }} - ls -ltr - - - name: Rename and zip the build-Darwin folder - run: |- - mv build-Darwin steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_arm64 - tar -czvf steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_arm64.tar.gz steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_arm64 - - - name: Save MacOS Build Artifact - AMD64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_arm64.tar.gz - path: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_arm64.tar.gz - if-no-files-found: error - - build-postgres-15-fdw-linux-amd64: - name: Build Postgres 15 FDW for Linux - AMD64 - runs-on: ubuntu-20.04 - - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Check out steampipe-postgres-fdw - uses: actions/checkout@v2 - with: - repository: "turbot/steampipe-postgres-fdw" - ref: main - - - name: Setup GoLang - uses: actions/setup-go@v4 - with: - go-version: 1.21 - - - 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 PostgreSQL15 Dev - run: |- - sudo apt-get -y install postgresql-server-dev-15 - - - 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)/15/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: Build steampipe-postgres-fdw-anywhere - run: | - pwd - ls -ltr - make standalone plugin=${{ env.PLUGIN_NAME }} - ls -ltr - - - name: Rename and zip the build-Linux folder - run: |- - mv build-Linux steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_amd64 - tar -czvf steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_amd64.tar.gz steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_amd64 - - - name: Save Linux Build Artifact - AMD64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_amd64.tar.gz - path: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_amd64.tar.gz - if-no-files-found: error - - build-postgres-15-fdw-linux-arm64: - name: Build Postgres 15 FDW for Linux - ARM64 - runs-on: - group: steampipe-darwin-arm-runners - - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Check out steampipe-postgres-fdw-anywhere - uses: actions/checkout@v3 - with: - repository: "turbot/steampipe-postgres-fdw" - ref: main - - - name: Check docker images available in runner - run: docker images - - - name: Run build script - run: | - chmod +x ./scripts/build-linux-arm-pg15.sh - bash ./scripts/build-linux-arm-pg15.sh ${{ env.PLUGIN_NAME }} - - - name: Check if binaries are available - run: ls -l $GITHUB_WORKSPACE - - - name: Save Linux Build Artifact - AMD64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_arm64.tar.gz - path: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_arm64.tar.gz - if-no-files-found: error - - build-postgres-15-fdw-osx-amd64: - name: Build Postgres 15 FDW for Darwin - AMD64 - runs-on: macos-latest - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Install PostgreSQL@15 - run: brew install postgresql@15 - - - 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: Check out steampipe-postgres-fdw - uses: actions/checkout@v2 - with: - repository: "turbot/steampipe-postgres-fdw" - ref: main - - - name: Setup Golang - uses: actions/setup-go@v4 - with: - go-version: 1.21 - - - name: Find stuff and set env - 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) - - - name: Build steampipe-postgres-fdw-anywhere - run: | - pwd - ls -ltr - make standalone plugin=${{ env.PLUGIN_NAME }} - ls -ltr - - - name: Rename and zip the build-Darwin folder - run: |- - mv build-Darwin steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_amd64 - tar -czvf steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_amd64.tar.gz steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_amd64 - - - name: Save MacOS Build Artifact - AMD64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_amd64.tar.gz - path: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_amd64.tar.gz - if-no-files-found: error - - build-postgres-15-fdw-osx-arm64: - name: Build Postgres 15 FDW for Darwin - ARM64 - runs-on: macos-14 - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Check architecture - run: uname -a - - name: Install PostgreSQL@15 - run: brew install postgresql@15 - - - name: Get the installation directory of the postgresql@15 formula - run: brew --prefix postgresql@15 - - - name: Configure PATH for PostgreSQL - run: echo $(brew --prefix postgresql@15)/bin >> $GITHUB_PATH - - - name: PGConfig - run: |- - which pg_config - ls -l $(which pg_config) - PGXS=$(pg_config --pgxs) - SERVER_LIB=$(pg_config --includedir)/postgresql/server - INTERNAL_LIB=$(pg_config --includedir)/postgresql/internal - - echo $PGXS - echo $SERVER_LIB - echo $INTERNAL_LIB - - ls -l $PGXS - ls -l $SERVER_LIB - ls -l $INTERNAL_LIB - - - name: Check out steampipe-postgres-fdw - uses: actions/checkout@v2 - with: - repository: "turbot/steampipe-postgres-fdw" - ref: main - - - name: Setup Golang - uses: actions/setup-go@v4 - with: - go-version: 1.21 - - - name: Find stuff and set env - run: |- - go version - - which pg_config - pg_config --version - - export PGXS=$(pg_config --pgxs) - - export SERVER_LIB=$(pg_config --includedir)/postgresql/server - export INTERNAL_LIB=$(pg_config --includedir)/postgresql/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) - - - name: Build steampipe-postgres-fdw-anywhere - run: | - pwd - ls -ltr - make standalone plugin=${{ env.PLUGIN_NAME }} - ls -ltr - - - name: Rename and zip the build-Darwin folder - run: |- - mv build-Darwin steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_arm64 - tar -czvf steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_arm64.tar.gz steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_arm64 - - - name: Save MacOS Build Artifact - ARM64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_arm64.tar.gz - path: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_arm64.tar.gz - if-no-files-found: error - - build-sqlite-extension-linux-amd64: - name: Build SQLite Extension for Linux - AMD64 - runs-on: ubuntu-latest - - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Check out steampipe-sqlite-extension - uses: actions/checkout@v2 - with: - repository: "turbot/steampipe-sqlite" - ref: main - - - name: Setup GoLang - uses: actions/setup-go@v4 - with: - go-version: 1.21 - - - name: Build steampipe-sqlite-extension - run: | - pwd - ls -ltr - make build plugin=${{ env.PLUGIN_NAME }} - ls -ltr - - - name: Zip and rename the steampipe_sqlite_${{ env.PLUGIN_NAME }}.so - run: |- - tar -czvf steampipe_sqlite_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz steampipe_sqlite_${{ env.PLUGIN_NAME }}.so - - - name: Save Linux Build Artifact - AMD64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_sqlite_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz - path: steampipe_sqlite_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz - if-no-files-found: error - - build-sqlite-extension-linux-arm64: - name: Build SQLite Extension for Linux - ARM64 - runs-on: - group: steampipe-darwin-arm-runners - - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Check out steampipe-sqlite-extension - uses: actions/checkout@v3 - with: - repository: "turbot/steampipe-sqlite" - ref: main - - - name: Check docker images available in runner - run: docker images - - - name: Run build script - run: | - chmod +x ./scripts/build-linux-arm-sqlite.sh - bash ./scripts/build-linux-arm-sqlite.sh ${{ env.PLUGIN_NAME }} - - - name: Check if binaries are available - run: ls -l $GITHUB_WORKSPACE - - - name: Save Linux Build Artifact - AMD64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_sqlite_${{ env.PLUGIN_NAME }}.linux_arm64.tar.gz - path: steampipe_sqlite_${{ env.PLUGIN_NAME }}.linux_arm64.tar.gz - if-no-files-found: error - - build-sqlite-extension-osx-amd64: - name: Build SQLite Extension for Darwin - AMD64 - runs-on: macos-latest - - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Check out steampipe-sqlite-extension - uses: actions/checkout@v2 - with: - repository: "turbot/steampipe-sqlite-extension" - ref: main - - - name: Setup GoLang - uses: actions/setup-go@v4 - with: - go-version: 1.21 - - - name: Build steampipe-sqlite-extension - run: | - pwd - ls -ltr - make build plugin=${{ env.PLUGIN_NAME }} - ls -ltr - - - name: Zip and rename the steampipe_sqlite_${{ env.PLUGIN_NAME }}.so - run: |- - tar -czvf steampipe_sqlite_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz steampipe_sqlite_${{ env.PLUGIN_NAME }}.so - - - name: Save Darwin Build Artifact - AMD64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_sqlite_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz - path: steampipe_sqlite_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz - if-no-files-found: error - - build-sqlite-extension-osx-arm64: - name: Build SQLite Extension for Darwin - ARM64 - runs-on: macos-14 - - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Check architecture - run: uname -a - - - name: Check out steampipe-sqlite-extension - uses: actions/checkout@v2 - with: - repository: "turbot/steampipe-sqlite-extension" - ref: main - - - name: Setup GoLang - uses: actions/setup-go@v4 - with: - go-version: 1.21 - - - name: Build steampipe-sqlite-extension - run: | - pwd - ls -ltr - make build plugin=${{ env.PLUGIN_NAME }} - ls -ltr - - - name: Zip and rename the steampipe_sqlite_${{ env.PLUGIN_NAME }}.so - run: |- - tar -czvf steampipe_sqlite_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz steampipe_sqlite_${{ env.PLUGIN_NAME }}.so - - - name: Save Darwin Build Artifact - ARM64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_sqlite_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz - path: steampipe_sqlite_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz - if-no-files-found: error - - build-export-tool: - name: Build Export Tool - runs-on: ubuntu_8_core - - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Check out steampipe-table-dump - uses: actions/checkout@v2 - with: - repository: "turbot/steampipe-table-dump" - ref: main - - - name: Setup GoLang - uses: actions/setup-go@v4 - with: - go-version: 1.21 - - - name: Build steampipe-table-dump - run: | - pwd - ls -ltr - make build plugin=${{ env.PLUGIN_NAME }} - ls -ltr - go mod tidy - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v5 - with: - version: latest - args: release --snapshot --skip-publish --rm-dist - - - name: Copy the gzipped binaries from dist - run: |- - ls -al dist/ - cp dist/steampipe_export_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz steampipe_export_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz - cp dist/steampipe_export_${{ env.PLUGIN_NAME }}.linux_arm64.tar.gz steampipe_export_${{ env.PLUGIN_NAME }}.linux_arm64.tar.gz - cp dist/steampipe_export_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz steampipe_export_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz - cp dist/steampipe_export_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz steampipe_export_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz - ls -al - - - name: Save Linux Build Artifact - AMD64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_export_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz - path: steampipe_export_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz - if-no-files-found: error - - - name: Save Linux Build Artifact - ARM64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_export_${{ env.PLUGIN_NAME }}.linux_arm64.tar.gz - path: steampipe_export_${{ env.PLUGIN_NAME }}.linux_arm64.tar.gz - if-no-files-found: error - - - name: Save Darwin Build Artifact - AMD64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_export_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz - path: steampipe_export_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz - if-no-files-found: error - - - name: Save Darwin Build Artifact - ARM64 - uses: actions/upload-artifact@v3 - with: - name: steampipe_export_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz - path: steampipe_export_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz - if-no-files-found: error - - build-draft-release: - name: Build Draft Release - runs-on: ubuntu-latest - needs: - # Postgres 14 - - build-postgres-14-fdw-linux-amd64 - - build-postgres-14-fdw-linux-arm64 - - build-postgres-14-fdw-osx-amd64 - - build-postgres-14-fdw-osx-arm64 - # Postgres 15 - - build-postgres-15-fdw-linux-amd64 - - build-postgres-15-fdw-linux-arm64 - - build-postgres-15-fdw-osx-amd64 - - build-postgres-15-fdw-osx-arm64 - # SQLite - - build-sqlite-extension-linux-amd64 - - build-sqlite-extension-linux-arm64 - - build-sqlite-extension-osx-amd64 - - build-sqlite-extension-osx-arm64 - # Export - - build-export-tool - steps: - - name: Set up job environment - run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV - else - echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - fi - - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Download steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_amd64.tar.gz - id: download_pg14_linux_amd64 - uses: actions/download-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_amd64.tar.gz - - - name: Download steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_arm64.tar.gz - id: download_pg14_linux_arm64 - uses: actions/download-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_arm64.tar.gz - - - name: Download steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_amd64.tar.gz - id: download_pg14_darwin_amd64 - uses: actions/download-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_amd64.tar.gz - - - name: Download steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_arm64.tar.gz - id: download_pg14_darwin_arm64 - uses: actions/download-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_arm64.tar.gz - - - name: Download steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_amd64.tar.gz - id: download_pg15_linux_amd64 - uses: actions/download-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_amd64.tar.gz - - - name: Download steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_arm64.tar.gz - id: download_pg15_linux_arm64 - uses: actions/download-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_arm64.tar.gz - - - name: Download steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_amd64.tar.gz - id: download_pg15_darwin_amd64 - uses: actions/download-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_amd64.tar.gz - - - name: Download steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_arm64.tar.gz - id: download_pg15_darwin_arm64 - uses: actions/download-artifact@v3 - with: - name: steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_arm64.tar.gz - - - name: Download steampipe_sqlite_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz - id: download_sqlite_linux_amd64 - uses: actions/download-artifact@v3 - with: - name: steampipe_sqlite_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz - - - name: Download steampipe_sqlite_${{ env.PLUGIN_NAME }}.linux_arm64.tar.gz - id: download_sqlite_linux_arm64 - uses: actions/download-artifact@v3 - with: - name: steampipe_sqlite_${{ env.PLUGIN_NAME }}.linux_arm64.tar.gz - - - name: Download steampipe_sqlite_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz - id: download_sqlite_darwin_amd64 - uses: actions/download-artifact@v3 - with: - name: steampipe_sqlite_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz - - - name: Download steampipe_sqlite_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz - id: download_sqlite_darwin_arm64 - uses: actions/download-artifact@v3 - with: - name: steampipe_sqlite_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz - - - name: Download steampipe_export_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz - id: download_export_linux_amd64 - uses: actions/download-artifact@v3 - with: - name: steampipe_export_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz - - - name: Download steampipe_export_${{ env.PLUGIN_NAME }}.linux_arm64.tar.gz - id: download_export_linux_arm64 - uses: actions/download-artifact@v3 - with: - name: steampipe_export_${{ env.PLUGIN_NAME }}.linux_arm64.tar.gz - - - name: Download steampipe_export_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz - id: download_export_darwin_amd64 - uses: actions/download-artifact@v3 - with: - name: steampipe_export_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz - - - name: Download steampipe_export_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz - id: download_export_darwin_arm64 - uses: actions/download-artifact@v3 - with: - name: steampipe_export_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz - - - name: Check Path - run: |- - ls -la - - - name: Get latest version tag - run: |- - echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - trim=${VERSION#"v"} - echo $trim - echo "VERSION=${trim}" >> $GITHUB_ENV - - - name: Create a draft release - uses: softprops/action-gh-release@v1 - id: create_draft_release - with: - draft: false - prerelease: false - name: ${{ env.VERSION }} - tag_name: ${{ env.VERSION }} - repository: ${{ github.repository }} - files: |- - ${{ steps.download_pg14_darwin_amd64.outputs.download-path }}/steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_amd64.tar.gz - ${{ steps.download_pg14_darwin_arm64.outputs.download-path }}/steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.darwin_arm64.tar.gz - ${{ steps.download_pg14_linux_amd64.outputs.download-path }}/steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_amd64.tar.gz - ${{ steps.download_pg14_linux_arm64.outputs.download-path }}/steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_arm64.tar.gz - - ${{ steps.download_pg15_darwin_amd64.outputs.download-path }}/steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_amd64.tar.gz - ${{ steps.download_pg15_darwin_arm64.outputs.download-path }}/steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.darwin_arm64.tar.gz - ${{ steps.download_pg15_linux_amd64.outputs.download-path }}/steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_amd64.tar.gz - ${{ steps.download_pg15_linux_arm64.outputs.download-path }}/steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_arm64.tar.gz - - ${{ steps.download_sqlite_darwin_amd64.outputs.download-path }}/steampipe_sqlite_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz - ${{ steps.download_sqlite_darwin_arm64.outputs.download-path }}/steampipe_sqlite_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz - ${{ steps.download_sqlite_linux_amd64.outputs.download-path }}/steampipe_sqlite_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz - ${{ steps.download_sqlite_linux_arm64.outputs.download-path }}/steampipe_sqlite_${{ env.PLUGIN_NAME }}.linux_arm64.tar.gz - - ${{ steps.download_export_darwin_amd64.outputs.download-path }}/steampipe_export_${{ env.PLUGIN_NAME }}.darwin_amd64.tar.gz - ${{ steps.download_export_darwin_arm64.outputs.download-path }}/steampipe_export_${{ env.PLUGIN_NAME }}.darwin_arm64.tar.gz - ${{ steps.download_export_linux_amd64.outputs.download-path }}/steampipe_export_${{ env.PLUGIN_NAME }}.linux_amd64.tar.gz - ${{ steps.download_export_linux_arm64.outputs.download-path }}/steampipe_export_${{ env.PLUGIN_NAME }}.linux_arm64.tar.gz - - check-installation-linux: - name: Check Installation(Linux) - runs-on: ubuntu-latest - needs: build-draft-release - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Install PostgreSQL14 Dev - run: |- - sudo apt-get -y install postgresql-server-dev-14 - - - name: Check pg_config version - run: pg_config --version - - - name: Download and install Postgres FDW - run: |- - curl -fsSL -o install_postgres_fdw.sh https://steampipe.io/install/postgres.sh - echo | sudo -E TERM=xterm bash install_postgres_fdw.sh ${{ env.PLUGIN_NAME }} latest 2>/dev/null - rm -f install_postgres_fdw.sh - - - name: Test Postgres FDW - run: |- - sudo service postgresql start - sudo -u postgres psql -c "CREATE EXTENSION IF NOT EXISTS steampipe_postgres_${{ env.PLUGIN_NAME }};" - sudo -u postgres psql -c "CREATE SERVER steampipe_${{ env.PLUGIN_NAME }} FOREIGN DATA WRAPPER steampipe_postgres_${{ env.PLUGIN_NAME }};" - sudo -u postgres psql -c "CREATE SCHEMA ${{ env.PLUGIN_NAME }};" - sudo -u postgres psql -c "IMPORT FOREIGN SCHEMA ${{ env.PLUGIN_NAME }} FROM SERVER steampipe_${{ env.PLUGIN_NAME }} INTO ${{ env.PLUGIN_NAME }};" - sudo -u postgres psql -c "SELECT * FROM pg_extension;" - - - name: Install SQLite3 - run: sudo apt-get install -y sqlite3 - - - name: Download and install SQLite Extension - run: |- - echo | TERM=xterm bash <(curl -fsSL https://steampipe.io/install/sqlite.sh) ${{ env.PLUGIN_NAME }} latest 2>/dev/null - - - name: Test SQLite Extension - run: | - echo ".load ./steampipe_sqlite_${{ env.PLUGIN_NAME }}" | sqlite3 - - - name: Download and install Export Tool - run: |- - curl -fsSL -o install_export.sh https://steampipe.io/install/export.sh - echo | sudo -E TERM=xterm bash install_export.sh ${{ env.PLUGIN_NAME }} latest 2>/dev/null - rm -f install_export.sh - - - name: Test Export Tool - run: | - steampipe_export_${{ env.PLUGIN_NAME }} --help - - check-installation-darwin: - name: Check Installation(Darwin) - runs-on: macos-latest - needs: build-draft-release - steps: - - name: Set environment variables - run: | - plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3) - echo $plugin_name - echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV - - - name: Install PostgreSQL14 - run: brew install postgresql@14 - - - name: Start PostgreSQL service - run: brew services start postgresql@14 - - - name: Check pg_config version - run: pg_config --version - - - name: Download and install Postgres FDW - run: |- - curl -fsSL -o install_postgres_fdw.sh https://steampipe.io/install/postgres.sh - echo | sudo -E TERM=xterm bash install_postgres_fdw.sh ${{ env.PLUGIN_NAME }} latest 2>/dev/null - rm -f install_postgres_fdw.sh - - - name: Configure PostgreSQL - run: |- - psql -d postgres -c "CREATE EXTENSION IF NOT EXISTS steampipe_postgres_${{ env.PLUGIN_NAME }};" - psql -d postgres -c "CREATE SERVER steampipe_${{ env.PLUGIN_NAME }} FOREIGN DATA WRAPPER steampipe_postgres_${{ env.PLUGIN_NAME }};" - psql -d postgres -c "CREATE SCHEMA ${{ env.PLUGIN_NAME }};" - psql -d postgres -c "IMPORT FOREIGN SCHEMA ${{ env.PLUGIN_NAME }} FROM SERVER steampipe_${{ env.PLUGIN_NAME }} INTO ${{ env.PLUGIN_NAME }};" - psql -d postgres -c "SELECT * FROM pg_extension;" - - - name: Download and install SQLite Extension - run: |- - echo | TERM=xterm bash <(curl -fsSL https://steampipe.io/install/sqlite.sh) ${{ env.PLUGIN_NAME }} latest 2>/dev/null - - - name: Download and install Export Tool - run: |- - curl -fsSL -o install_export.sh https://steampipe.io/install/export.sh - echo | sudo -E TERM=xterm bash install_export.sh ${{ env.PLUGIN_NAME }} latest 2>/dev/null - rm -f install_export.sh - - - name: Test Export Tool - run: | - steampipe_export_${{ env.PLUGIN_NAME }} --help \ No newline at end of file +jobs: + anywhere_publish_workflow: + uses: turbot/steampipe-workflows/.github/workflows/steampipe-anywhere-aws.yml@main + secrets: inherit