1+ name : Build and Publish Dry Run libpq-query no windows 🏗
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ make-release-candidate :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : Checkout Repository 📥
11+ uses : actions/checkout@v4
12+
13+ - name : Setup Node.js 🌐
14+ uses : actions/setup-node@v4
15+ with :
16+ node-version : ' 20.x'
17+ cache : ' yarn'
18+
19+ build-artifacts :
20+ needs : make-release-candidate
21+ runs-on : ${{ matrix.os }}
22+ strategy :
23+ matrix :
24+ os : [macos-latest, ubuntu-latest]
25+ steps :
26+ - name : Checkout Repository 📥
27+ uses : actions/checkout@v4
28+
29+ - name : Setup Node.js 🌐
30+ uses : actions/setup-node@v4
31+ with :
32+ node-version : ' 20.x'
33+ cache : ' yarn'
34+
35+ - name : Install and Build 📦
36+ run : |
37+ yarn
38+ yarn binary:build
39+
40+ - name : Save Artifacts For Supabase CDN 🏗
41+ uses : actions/upload-artifact@v4
42+ with :
43+ name : build-supabase-artifact-${{ matrix.os }}
44+ path : ' ./build/stage/libpg-query-node/'
45+
46+ - name : Save Artifacts For NPM 🏗
47+ uses : actions/upload-artifact@v4
48+ with :
49+ name : build-npm-artifact-${{ matrix.os }}
50+ path : |
51+ ${{ matrix.os == 'macos-latest' && './libpg_query/osx/libpg_query.a' ||
52+ matrix.os == 'ubuntu-latest' && './libpg_query/linux/libpg_query.a' }}
53+
54+ build-wasm :
55+ needs : build-artifacts
56+ runs-on : ubuntu-latest
57+ steps :
58+ - name : Checkout Repository 📥
59+ uses : actions/checkout@v4
60+
61+ - name : Setup Node.js 🌐
62+ uses : actions/setup-node@v4
63+ with :
64+ node-version : ' 20.x'
65+ cache : ' yarn'
66+
67+ - name : Install and Build 🚀
68+ run : |
69+ yarn
70+
71+ - name : Install Emscripten ✍🏻
72+ run : |
73+ sudo apt-get update
74+ sudo apt-get install cmake python3 python3-pip
75+ git clone --branch 3.1.59 --depth 1 https://github.com/emscripten-core/emsdk.git
76+ cd emsdk
77+ ./emsdk install 3.1.59
78+ ./emsdk activate 3.1.59
79+ source ./emsdk_env.sh
80+
81+ - name : Build with Emscripten 🏗
82+ run : |
83+ source ./emsdk/emsdk_env.sh
84+ emmake make
85+ emmake make build
86+
87+ - name : Archive production artifacts 🏛
88+ uses : actions/upload-artifact@v4
89+ with :
90+ name : wasm-artifacts
91+ path : wasm
92+
93+ prepare-and-publish :
94+ needs : build-wasm
95+ runs-on : ubuntu-latest
96+ steps :
97+ - name : Checkout Repository 📥
98+ uses : actions/checkout@v4
99+
100+ - name : Get Artifacts 📚
101+ uses : actions/download-artifact@v4
102+ with :
103+ path : downloaded-artifacts
104+
105+ - name : Prepare artifacts 📦
106+ run : |
107+ find ./downloaded-artifacts/
108+ cp ./downloaded-artifacts/build-npm-artifact-ubuntu-latest/libpg_query.a ./libpg_query/linux/libpg_query.a
109+ cp ./downloaded-artifacts/build-npm-artifact-macos-latest/libpg_query.a ./libpg_query/osx/libpg_query.a
110+ cp ./downloaded-artifacts/wasm-artifacts/libpg-query.js ./wasm/libpg-query.js
111+ cp ./downloaded-artifacts/wasm-artifacts/libpg-query.wasm ./wasm/libpg-query.wasm
112+ rm -rf ./downloaded-artifacts
113+
114+ # - name: Setup AWS CLI
115+ # run: sudo apt-get update && sudo apt-get install awscli -y
116+
117+ # - name: Configure AWS Credentials
118+ # uses: aws-actions/configure-aws-credentials@v4
119+ # with:
120+ # aws-access-key-id: ${{ secrets.SUPABASE_AWS_KEY }}
121+ # aws-secret-access-key: ${{ secrets.SUPABASE_AWS_SECRET }}
122+ # aws-region: us-east-1
123+
124+ # - name: List Bucket Contents
125+ # run: aws s3 ls s3://supabase-public-artifacts-bucket/
126+
127+ # - name: Publish to NPM 🚀
128+ # run: |
129+ # npm publish
130+ # env:
131+ # NODE_AUTH_TOKEN: ${{secrets.NPM_API_KEY}}
0 commit comments