Skip to content

Commit 1fe9663

Browse files
authored
chore(ci): Publish - compile fallback/python builds for native (#6662)
1 parent a8878f8 commit 1fe9663

File tree

3 files changed

+37
-9
lines changed

3 files changed

+37
-9
lines changed

.github/workflows/publish.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,19 @@ jobs:
6464

6565
native_linux:
6666
runs-on: ubuntu-20.04
67-
env:
68-
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69-
PACKAGE_TARGET_ARCH: ${{ matrix.package_target_arch }}
70-
PACKAGE_TARGET_PLATFORM: ${{ matrix.package_target_platform }}
71-
PACKAGE_TARGET_LIBC: ${{ matrix.package_target_libc }}
7267
timeout-minutes: 60
7368
name: Build native Linux ${{ matrix.node-version }} ${{ matrix.target }}
7469
strategy:
7570
matrix:
7671
node-version: [16]
72+
python-version: ["3.11", "fallback"]
7773
target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
7874
include:
75+
- target: x86_64-unknown-linux-gnu
76+
package_target_arch: x64
77+
package_target_platform: linux
78+
package_target_libc: glibc
7979
- target: aarch64-unknown-linux-gnu
80-
# We use cross for this type, it's why we need to override package
8180
package_target_arch: arm64
8281
package_target_platform: linux
8382
package_target_libc: glibc
@@ -128,10 +127,17 @@ jobs:
128127
command: yarn install --frozen-lockfile
129128
- name: Compile TypeScript
130129
run: yarn tsc
131-
- name: Build native
130+
- name: Build native (fallback)
131+
if: (matrix.python-version == 'fallback')
132132
env:
133133
CARGO_BUILD_TARGET: ${{ matrix.target }}
134134
run: cd packages/cubejs-backend-native && npm run native:build-release
135+
- name: Build native (with Python)
136+
if: (matrix.python-version != 'fallback')
137+
env:
138+
PYO3_PYTHON: python${{ matrix.python-version }}
139+
CARGO_BUILD_TARGET: ${{ matrix.target }}
140+
run: cd packages/cubejs-backend-native && npm run native:build-release-python
135141
- name: Upload artifact
136142
uses: nick-invision/retry@v2
137143
with:
@@ -142,6 +148,22 @@ jobs:
142148
command: |
143149
cd packages/cubejs-backend-native
144150
npm run upload-binary-cross
151+
- name: Archive release asset
152+
shell: bash
153+
run: |
154+
cd packages/cubejs-backend-native
155+
mkdir native
156+
cp index.node native/index.node
157+
tar czvf native.tar.gz native
158+
- name: Upload to Release
159+
uses: svenstaro/upload-release-action@v2
160+
with:
161+
repo_token: ${{ secrets.GITHUB_TOKEN }}
162+
file: packages/cubejs-backend-native/native.tar.gz
163+
# Example: native-linux-arm64-glibc.tar.gz
164+
asset_name: native-${{ matrix.package_target_platform }}-${{ matrix.package_target_arch }}-${{ matrix.package_target_libc }}-${{ matrix.python-version }}.tar.gz
165+
tag: ${{ github.ref }}
166+
overwrite: true
145167

146168
native:
147169
runs-on: ${{ matrix.os-version }}

.github/workflows/rust-cubesql.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ jobs:
186186
- name: Build native (with Python)
187187
if: (matrix.python-version != 'false')
188188
env:
189+
PYO3_PYTHON: python${{ matrix.python-version }}
189190
CARGO_BUILD_TARGET: ${{ matrix.target }}
190191
run: cd packages/cubejs-backend-native && yarn run native:build-debug-python
191192
- name: Test native (GNU only)
@@ -269,7 +270,12 @@ jobs:
269270
run: cd packages/cubejs-backend-native && yarn run native:build && yarn run test:unit
270271
- name: Build native (with Python)
271272
if: (matrix.python-version != 'false')
273+
# todo(ovr): not working on windows..
274+
#env:
275+
# PYO3_PYTHON: python${{ matrix.python-version }}
276+
run: cd packages/cubejs-backend-native && yarn run native:build-debug-python
277+
- name: Tests
272278
env:
273279
CUBESQL_STREAM_MODE: true
274280
CUBEJS_NATIVE_INTERNAL_DEBUG: true
275-
run: cd packages/cubejs-backend-native && yarn run native:build-debug-python && yarn run test:unit
281+
run: cd packages/cubejs-backend-native && yarn run test:unit

packages/cubejs-backend-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"module_name": "index",
5252
"host": "https://github.com/cube-js/cube/releases/download/",
5353
"remote_path": "v{version}",
54-
"package_name": "native-{platform}-{arch}-{libc}.tar.gz",
54+
"package_name": "native-{platform}-{arch}-{libc}-fallback.tar.gz",
5555
"module_path": "native",
5656
"pkg_path": "."
5757
},

0 commit comments

Comments
 (0)