@@ -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 }}
0 commit comments