Skip to content

Commit 4e2ce6e

Browse files
committed
workflows
1 parent 35fd443 commit 4e2ce6e

File tree

2 files changed

+288
-0
lines changed

2 files changed

+288
-0
lines changed

.github/workflows/publish-minor.yaml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: Build and Publish Release Candidate libpq-query 🏗
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+
- name: Configure Git 🛠
20+
run: |
21+
git config user.name "LaunchQL"
22+
git config user.email "[email protected]"
23+
24+
- name: Minor Version 🧪
25+
run: |
26+
git fetch
27+
npm version minor
28+
git push
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
32+
build-artifacts:
33+
needs: make-release-candidate
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
matrix:
37+
os: [macos-latest, ubuntu-latest]
38+
steps:
39+
- name: Checkout Repository 📥
40+
uses: actions/checkout@v4
41+
42+
- name: Setup Node.js 🌐
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: '20.x'
46+
cache: 'yarn'
47+
48+
- name: Install and Build 📦
49+
run: |
50+
yarn
51+
yarn binary:build
52+
53+
- name: Save Artifacts For Supabase CDN 🏗
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: build-supabase-artifact-${{ matrix.os }}
57+
path: './build/stage/libpg-query-node/'
58+
59+
- name: Save Artifacts For NPM 🏗
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: build-npm-artifact-${{ matrix.os }}
63+
path: |
64+
${{ matrix.os == 'macos-latest' && './libpg_query/osx/libpg_query.a' ||
65+
matrix.os == 'ubuntu-latest' && './libpg_query/linux/libpg_query.a' }}
66+
67+
build-wasm:
68+
needs: build-artifacts
69+
runs-on: ubuntu-latest
70+
steps:
71+
- name: Checkout Repository 📥
72+
uses: actions/checkout@v4
73+
74+
- name: Setup Node.js 🌐
75+
uses: actions/setup-node@v4
76+
with:
77+
node-version: '20.x'
78+
cache: 'yarn'
79+
80+
- name: Install and Build 🚀
81+
run: |
82+
yarn
83+
84+
- name: Install Emscripten ✍🏻
85+
run: |
86+
sudo apt-get update
87+
sudo apt-get install cmake python3 python3-pip
88+
git clone --branch 3.1.59 --depth 1 https://github.com/emscripten-core/emsdk.git
89+
cd emsdk
90+
./emsdk install 3.1.59
91+
./emsdk activate 3.1.59
92+
source ./emsdk_env.sh
93+
94+
- name: Build with Emscripten 🏗
95+
run: |
96+
source ./emsdk/emsdk_env.sh
97+
emmake make
98+
emmake make build
99+
100+
- name: Archive production artifacts 🏛
101+
uses: actions/upload-artifact@v4
102+
with:
103+
name: wasm-artifacts
104+
path: wasm
105+
106+
prepare-and-publish:
107+
needs: build-wasm
108+
runs-on: ubuntu-latest
109+
steps:
110+
- name: Checkout Repository 📥
111+
uses: actions/checkout@v4
112+
113+
- name: Get Artifacts 📚
114+
uses: actions/download-artifact@v4
115+
with:
116+
path: downloaded-artifacts
117+
118+
- name: Prepare artifacts 📦
119+
run: |
120+
find ./downloaded-artifacts/
121+
cp ./downloaded-artifacts/build-npm-artifact-ubuntu-latest/libpg_query.a ./libpg_query/linux/libpg_query.a
122+
cp ./downloaded-artifacts/build-npm-artifact-macos-latest/libpg_query.a ./libpg_query/osx/libpg_query.a
123+
cp ./downloaded-artifacts/wasm-artifacts/libpg-query.js ./wasm/libpg-query.js
124+
cp ./downloaded-artifacts/wasm-artifacts/libpg-query.wasm ./wasm/libpg-query.wasm
125+
rm -rf ./downloaded-artifacts
126+
127+
# - name: Setup AWS CLI
128+
# run: sudo apt-get update && sudo apt-get install awscli -y
129+
130+
# - name: Configure AWS Credentials
131+
# uses: aws-actions/configure-aws-credentials@v4
132+
# with:
133+
# aws-access-key-id: ${{ secrets.SUPABASE_AWS_KEY }}
134+
# aws-secret-access-key: ${{ secrets.SUPABASE_AWS_SECRET }}
135+
# aws-region: us-east-1
136+
137+
# - name: List Bucket Contents
138+
# run: aws s3 ls s3://supabase-public-artifacts-bucket/
139+
140+
# - name: Publish to NPM 🚀
141+
# run: |
142+
# npm publish
143+
# env:
144+
# NODE_AUTH_TOKEN: ${{secrets.NPM_API_KEY}}
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: Build and Publish Release Candidate libpq-query 🏗
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+
- name: Configure Git 🛠
20+
run: |
21+
git config user.name "LaunchQL"
22+
git config user.email "[email protected]"
23+
24+
- name: Release candidate 🧪
25+
run: |
26+
git fetch
27+
npm version prerelease --preid=rc
28+
git push
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
32+
build-artifacts:
33+
needs: make-release-candidate
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
matrix:
37+
os: [macos-latest, ubuntu-latest]
38+
steps:
39+
- name: Checkout Repository 📥
40+
uses: actions/checkout@v4
41+
42+
- name: Setup Node.js 🌐
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: '20.x'
46+
cache: 'yarn'
47+
48+
- name: Install and Build 📦
49+
run: |
50+
yarn
51+
yarn binary:build
52+
53+
- name: Save Artifacts For Supabase CDN 🏗
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: build-supabase-artifact-${{ matrix.os }}
57+
path: './build/stage/libpg-query-node/'
58+
59+
- name: Save Artifacts For NPM 🏗
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: build-npm-artifact-${{ matrix.os }}
63+
path: |
64+
${{ matrix.os == 'macos-latest' && './libpg_query/osx/libpg_query.a' ||
65+
matrix.os == 'ubuntu-latest' && './libpg_query/linux/libpg_query.a' }}
66+
67+
build-wasm:
68+
needs: build-artifacts
69+
runs-on: ubuntu-latest
70+
steps:
71+
- name: Checkout Repository 📥
72+
uses: actions/checkout@v4
73+
74+
- name: Setup Node.js 🌐
75+
uses: actions/setup-node@v4
76+
with:
77+
node-version: '20.x'
78+
cache: 'yarn'
79+
80+
- name: Install and Build 🚀
81+
run: |
82+
yarn
83+
84+
- name: Install Emscripten ✍🏻
85+
run: |
86+
sudo apt-get update
87+
sudo apt-get install cmake python3 python3-pip
88+
git clone --branch 3.1.59 --depth 1 https://github.com/emscripten-core/emsdk.git
89+
cd emsdk
90+
./emsdk install 3.1.59
91+
./emsdk activate 3.1.59
92+
source ./emsdk_env.sh
93+
94+
- name: Build with Emscripten 🏗
95+
run: |
96+
source ./emsdk/emsdk_env.sh
97+
emmake make
98+
emmake make build
99+
100+
- name: Archive production artifacts 🏛
101+
uses: actions/upload-artifact@v4
102+
with:
103+
name: wasm-artifacts
104+
path: wasm
105+
106+
prepare-and-publish:
107+
needs: build-wasm
108+
runs-on: ubuntu-latest
109+
steps:
110+
- name: Checkout Repository 📥
111+
uses: actions/checkout@v4
112+
113+
- name: Get Artifacts 📚
114+
uses: actions/download-artifact@v4
115+
with:
116+
path: downloaded-artifacts
117+
118+
- name: Prepare artifacts 📦
119+
run: |
120+
find ./downloaded-artifacts/
121+
cp ./downloaded-artifacts/build-npm-artifact-ubuntu-latest/libpg_query.a ./libpg_query/linux/libpg_query.a
122+
cp ./downloaded-artifacts/build-npm-artifact-macos-latest/libpg_query.a ./libpg_query/osx/libpg_query.a
123+
cp ./downloaded-artifacts/wasm-artifacts/libpg-query.js ./wasm/libpg-query.js
124+
cp ./downloaded-artifacts/wasm-artifacts/libpg-query.wasm ./wasm/libpg-query.wasm
125+
rm -rf ./downloaded-artifacts
126+
127+
# - name: Setup AWS CLI
128+
# run: sudo apt-get update && sudo apt-get install awscli -y
129+
130+
# - name: Configure AWS Credentials
131+
# uses: aws-actions/configure-aws-credentials@v4
132+
# with:
133+
# aws-access-key-id: ${{ secrets.SUPABASE_AWS_KEY }}
134+
# aws-secret-access-key: ${{ secrets.SUPABASE_AWS_SECRET }}
135+
# aws-region: us-east-1
136+
137+
# - name: List Bucket Contents
138+
# run: aws s3 ls s3://supabase-public-artifacts-bucket/
139+
140+
# - name: Publish to NPM 🚀
141+
# run: |
142+
# npm publish
143+
# env:
144+
# NODE_AUTH_TOKEN: ${{secrets.NPM_API_KEY}}

0 commit comments

Comments
 (0)