-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (121 loc) Β· 4.11 KB
/
publish-release-candidate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Build and Publish Release Candidate libpq-query π
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'
- name: Configure Git π
run: |
git config user.name "LaunchQL"
git config user.email "[email protected]"
- name: Release candidate π§ͺ
run: |
git fetch
npm version prerelease --preid=rc
git push
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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}}