|
| 1 | +name: Generated Build libpg-query no windows 🛠 |
| 2 | +'on': |
| 3 | + workflow_dispatch: null |
| 4 | +jobs: |
| 5 | + build-artifacts: |
| 6 | + runs-on: ${{ matrix.os }} |
| 7 | + strategy: |
| 8 | + matrix: |
| 9 | + os: |
| 10 | + - macos-latest |
| 11 | + - ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout Repository 📥 |
| 14 | + uses: actions/checkout@v4 |
| 15 | + - name: Setup Node.js 🌐 |
| 16 | + uses: actions/setup-node@v4 |
| 17 | + with: |
| 18 | + node-version: 20.x |
| 19 | + cache: yarn |
| 20 | + - name: Configure Git 🛠 |
| 21 | + run: | |
| 22 | + git config user.name "Cosmology" |
| 23 | + git config user.email "[email protected]" |
| 24 | + - name: Install and Build 📦 |
| 25 | + run: | |
| 26 | + yarn |
| 27 | + yarn binary:build |
| 28 | + - name: Save Artifacts For Supabase CDN 🏗 |
| 29 | + uses: actions/upload-artifact@v4 |
| 30 | + with: |
| 31 | + name: build-supabase-artifact-${{ matrix.os }} |
| 32 | + path: ./build/stage/libpg-query-node/ |
| 33 | + - name: Save Artifacts For NPM 🏗 |
| 34 | + uses: actions/upload-artifact@v4 |
| 35 | + with: |
| 36 | + name: build-npm-artifact-${{ matrix.os }} |
| 37 | + path: | |
| 38 | + ${{ matrix.os == 'macos-latest' && './libpg_query/osx/libpg_query.a' || |
| 39 | + matrix.os == 'ubuntu-latest' && './libpg_query/linux/libpg_query.a' }} |
| 40 | + build-wasm: |
| 41 | + needs: build-artifacts |
| 42 | + runs-on: ubuntu-latest |
| 43 | + steps: |
| 44 | + - name: Checkout Repository 📥 |
| 45 | + uses: actions/checkout@v4 |
| 46 | + - name: Setup Node.js 🌐 |
| 47 | + uses: actions/setup-node@v4 |
| 48 | + with: |
| 49 | + node-version: 20.x |
| 50 | + cache: yarn |
| 51 | + - name: Install and Build 🚀 |
| 52 | + run: | |
| 53 | + yarn |
| 54 | + - name: Install Emscripten ✍🏻 |
| 55 | + run: | |
| 56 | + sudo apt-get update |
| 57 | + sudo apt-get install cmake python3 python3-pip |
| 58 | + git clone --branch 3.1.59 --depth 1 https://github.com/emscripten-core/emsdk.git |
| 59 | + cd emsdk |
| 60 | + ./emsdk install 3.1.59 |
| 61 | + ./emsdk activate 3.1.59 |
| 62 | + source ./emsdk_env.sh |
| 63 | + - name: Build with Emscripten 🏗 |
| 64 | + run: | |
| 65 | + source ./emsdk/emsdk_env.sh |
| 66 | + emmake make |
| 67 | + emmake make build |
| 68 | + - name: Archive production artifacts 🏛 |
| 69 | + uses: actions/upload-artifact@v4 |
| 70 | + with: |
| 71 | + name: wasm-artifacts |
| 72 | + path: wasm |
| 73 | + prepare-and-log: |
| 74 | + needs: build-wasm |
| 75 | + runs-on: ubuntu-latest |
| 76 | + steps: |
| 77 | + - name: Checkout Repository 📥 |
| 78 | + uses: actions/checkout@v4 |
| 79 | + - name: Get Artifacts 📚 |
| 80 | + uses: actions/download-artifact@v4 |
| 81 | + with: |
| 82 | + path: downloaded-artifacts |
| 83 | + - name: Prepare artifacts 📦 |
| 84 | + run: | |
| 85 | + find ./downloaded-artifacts/ |
| 86 | + cp ./downloaded-artifacts/build-npm-artifact-windows-latest/pg_query.lib ./libpg_query/windows/queryparser.lib |
| 87 | + cp ./downloaded-artifacts/build-npm-artifact-ubuntu-latest/libpg_query.a ./libpg_query/linux/libpg_query.a |
| 88 | + cp ./downloaded-artifacts/build-npm-artifact-macos-latest/libpg_query.a ./libpg_query/osx/libpg_query.a |
| 89 | + cp ./downloaded-artifacts/wasm-artifacts/libpg-query.js ./wasm/libpg-query.js |
| 90 | + cp ./downloaded-artifacts/wasm-artifacts/libpg-query.wasm ./wasm/libpg-query.wasm |
| 91 | + rm -rf ./downloaded-artifacts |
| 92 | + - name: Log |
| 93 | + run: | |
| 94 | + find ./libpg_query/ |
| 95 | + find ./wasm |
0 commit comments