Skip to content

Build and Publish Dry Run libpq-query no windows πŸ— #3

Build and Publish Dry Run libpq-query no windows πŸ—

Build and Publish Dry Run libpq-query no windows πŸ— #3

name: Build and Publish Dry Run libpq-query no windows πŸ—
on:
workflow_dispatch:
jobs:
make-release-candidate:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository πŸ“₯
uses: actions/checkout@v4
- name: Setup Node.js 🌐
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
build-artifacts:
needs: make-release-candidate
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- name: Checkout Repository πŸ“₯
uses: actions/checkout@v4
- name: Setup Node.js 🌐
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
- name: Install and Build πŸ“¦
run: |
yarn
yarn binary:build
- name: Save Artifacts For Supabase CDN πŸ—
uses: actions/upload-artifact@v4
with:
name: build-supabase-artifact-${{ matrix.os }}
path: './build/stage/libpg-query-node/'
- name: Save Artifacts For NPM πŸ—
uses: actions/upload-artifact@v4
with:
name: build-npm-artifact-${{ matrix.os }}
path: |
${{ matrix.os == 'macos-latest' && './libpg_query/osx/libpg_query.a' ||
matrix.os == 'ubuntu-latest' && './libpg_query/linux/libpg_query.a' }}
build-wasm:
needs: build-artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout Repository πŸ“₯
uses: actions/checkout@v4
- name: Setup Node.js 🌐
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
- name: Install and Build πŸš€
run: |
yarn
- name: Install Emscripten ✍🏻
run: |
sudo apt-get update
sudo apt-get install cmake python3 python3-pip
git clone --branch 3.1.59 --depth 1 https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 3.1.59
./emsdk activate 3.1.59
source ./emsdk_env.sh
- name: Build with Emscripten πŸ—
run: |
source ./emsdk/emsdk_env.sh
emmake make
emmake make build
- name: Archive production artifacts πŸ›
uses: actions/upload-artifact@v4
with:
name: wasm-artifacts
path: wasm
prepare-and-publish:
needs: build-wasm
runs-on: ubuntu-latest
steps:
- name: Checkout Repository πŸ“₯
uses: actions/checkout@v4
- name: Get Artifacts πŸ“š
uses: actions/download-artifact@v4
with:
path: downloaded-artifacts
- name: Prepare artifacts πŸ“¦
run: |
find ./downloaded-artifacts/
cp ./downloaded-artifacts/build-npm-artifact-ubuntu-latest/libpg_query.a ./libpg_query/linux/libpg_query.a
cp ./downloaded-artifacts/build-npm-artifact-macos-latest/libpg_query.a ./libpg_query/osx/libpg_query.a
cp ./downloaded-artifacts/wasm-artifacts/libpg-query.js ./wasm/libpg-query.js
cp ./downloaded-artifacts/wasm-artifacts/libpg-query.wasm ./wasm/libpg-query.wasm
rm -rf ./downloaded-artifacts
# - name: Setup AWS CLI
# run: sudo apt-get update && sudo apt-get install awscli -y
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-access-key-id: ${{ secrets.SUPABASE_AWS_KEY }}
# aws-secret-access-key: ${{ secrets.SUPABASE_AWS_SECRET }}
# aws-region: us-east-1
# - name: List Bucket Contents
# run: aws s3 ls s3://supabase-public-artifacts-bucket/
# - name: Publish to NPM πŸš€
# run: |
# npm publish
# env:
# NODE_AUTH_TOKEN: ${{secrets.NPM_API_KEY}}