diff --git a/.github/workflows/steampipe-anywhere.yml b/.github/workflows/steampipe-anywhere.yml index c0882754..c36b875e 100644 --- a/.github/workflows/steampipe-anywhere.yml +++ b/.github/workflows/steampipe-anywhere.yml @@ -7,8 +7,964 @@ on: jobs: - anywhere_publish_workflow: - uses: turbot/steampipe-workflows/.github/workflows/steampipe-anywhere.yml@main - secrets: inherit + build-postgres-14-fdw-linux-amd64: + name: Build Postgres 14 FDW for Linux - AMD64 runs-on: - labels: ubuntu_4_core \ No newline at end of file + labels: ubuntu_4_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-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: macos-latest-xlarge + + # steps: + # - name: Check out steampipe-postgres-fdw + # uses: actions/checkout@v2 + # with: + # repository: "turbot/steampipe-postgres-fdw" + # ref: main + + # - name: Install Homebrew (if not installed) + # run: | + # which brew || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + # - name: Install Docker + # run: | + # brew install --cask docker + # which docker + # docker --version + + # - name: Build docker image + # run: |- + # docker build --pull -f anywhere.Dockerfile -t steampipe_fdw_builder --build-arg="pg_version=14" ${{ github.action_path }}../ + + # - name: Build steampipe-postgres-fdw - ${{ env.PLUGIN_NAME }} + # run: | + # pwd + # ls -ltr + # docker run -it --rm --name sp_fdw_builder -v $(pwd):/tmp/ext steampipe_fdw_builder 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_arm64 + # tar -czvf steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_arm64.tar.gz steampipe_postgres_${{ env.PLUGIN_NAME }}.pg14.linux_arm64 + + # - name: Save Linux Build Artifact - ARM64 + # 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-latest-xlarge + 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: + labels: ubuntu_4_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-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: macos-latest-xlarge + + # steps: + # - name: Check out steampipe-postgres-fdw + # uses: actions/checkout@v2 + # with: + # repository: "turbot/steampipe-postgres-fdw" + # ref: main + + # - name: Install Homebrew (if not installed) + # run: | + # which brew || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + # - name: Install Docker + # run: | + # brew install --cask docker + # which docker + # docker --version + + # - name: Build docker image + # run: |- + # docker build --pull -f anywhere.Dockerfile -t steampipe_fdw_builder --build-arg="pg_version=15" ${{ github.action_path }}../ + + # - name: Build steampipe-postgres-fdw - ${{ env.PLUGIN_NAME }} + # run: | + # pwd + # ls -ltr + # docker run -it --rm --name sp_fdw_builder -v $(pwd):/tmp/ext steampipe_fdw_builder 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_arm64 + # tar -czvf steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_arm64.tar.gz steampipe_postgres_${{ env.PLUGIN_NAME }}.pg15.linux_arm64 + + # - name: Save Linux Build Artifact - ARM64 + # 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-latest-xlarge + 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: Configure PATH for PostgreSQL + run: echo "/opt/homebrew/Cellar/postgresql@15/15.5_1/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: + labels: ubuntu_4_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-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 }}.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: macos-latest-xlarge + + # steps: + # - 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: Install Homebrew (if not installed) + # run: | + # which brew || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + # - name: Install Docker + # run: | + # brew install --cask docker + # which docker + # docker --version + + # - name: Build docker image + # run: |- + # docker build --pull -f anywhere.Dockerfile -t steampipe_sqlite_builder ${{ github.action_path }}../ + + # - name: Build steampipe-sqlite-extension - ${{ env.PLUGIN_NAME }} + # run: | + # pwd + # ls -ltr + # docker run -it --rm --name sp_sqlite_builder -v $(pwd):/tmp/ext steampipe_sqlite_builder 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_arm64.tar.gz steampipe_sqlite_${{ env.PLUGIN_NAME }}.so + + # - name: Save Linux 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-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-latest-xlarge + + 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: + labels: ubuntu_4_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: + labels: ubuntu_4_core + 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 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_arm.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: true + 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_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_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_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