Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow dev version of Python wheels to be built and published #2066

Merged
merged 4 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,50 @@ on:
type: boolean
required: true
default: false
skipBinaries:
description: "Skip building precompiled binaries?"
type: boolean
required: true
default: false
skipJava:
description: "Skip building Java?"
type: boolean
required: true
default: false
skipNodejs:
description: "Skip building Node.js?"
type: boolean
required: true
default: false
skipPython:
description: "Skip building Python?"
type: boolean
required: true
default: false
skipRust:
description: "Skip building Rust?"
type: boolean
required: true
default: false

jobs:
build-java-mac:
if: ${{ github.event.inputs.skipJava != 'true' }}
uses: ./.github/workflows/mac-java-workflow.yml
secrets: inherit

build-java-linux:
if: ${{ github.event.inputs.skipJava != 'true' }}
uses: ./.github/workflows/linux-java-workflow.yml
secrets: inherit

build-java-windows:
if: ${{ github.event.inputs.skipJava != 'true' }}
uses: ./.github/workflows/windows-java-workflow.yml
secrets: inherit

inject-java-bins:
if: ${{ github.event.inputs.skipJava != 'true' }}
needs: [build-java-mac, build-java-linux, build-java-windows]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -59,18 +88,22 @@ jobs:
path: java-bins/kuzu_java.jar

build-nodejs-mac:
if: ${{ github.event.inputs.skipNodejs != 'true' }}
uses: ./.github/workflows/mac-nodejs-workflow.yml
secrets: inherit

build-nodejs-linux:
if: ${{ github.event.inputs.skipNodejs != 'true' }}
uses: ./.github/workflows/linux-nodejs-workflow.yml
secrets: inherit

build-nodejs-windows:
if: ${{ github.event.inputs.skipNodejs != 'true' }}
uses: ./.github/workflows/windows-nodejs-workflow.yml
secrets: inherit

deploy-nodejs:
if: ${{ github.event.inputs.skipNodejs != 'true' }}
needs: [build-nodejs-mac, build-nodejs-linux, build-nodejs-windows]
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -131,18 +164,22 @@ jobs:
working-directory: tools/nodejs_api

build-wheel-mac:
if: ${{ github.event.inputs.skipPython != 'true' }}
uses: ./.github/workflows/mac-wheel-workflow.yml
secrets: inherit

build-wheel-linux:
if: ${{ github.event.inputs.skipPython != 'true' }}
uses: ./.github/workflows/linux-wheel-workflow.yml
secrets: inherit

build-wheel-windows:
if: ${{ github.event.inputs.skipPython != 'true' }}
uses: ./.github/workflows/windows-wheel-workflow.yml
secrets: inherit

package-python-sdist:
if: ${{ github.event.inputs.skipPython != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -158,6 +195,7 @@ jobs:
path: scripts/pip-package/*.tar.gz

deploy-python:
if: ${{ github.event.inputs.skipPython != 'true' }}
needs:
[
build-wheel-mac,
Expand Down Expand Up @@ -216,6 +254,7 @@ jobs:
password: ${{ secrets.PYPI_TOKEN }}

deploy-rust:
if: ${{ github.event.inputs.skipRust != 'true' }}
runs-on: kuzu-self-hosted-testing
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Expand Down Expand Up @@ -243,13 +282,16 @@ jobs:
path: tools/rust_api/target/package/*.crate

build-precompiled-bin-mac:
if: ${{ github.event.inputs.skipBinaries != 'true' }}
uses: ./.github/workflows/mac-precompiled-bin-workflow.yml
secrets: inherit

build-precompiled-bin-linux:
if: ${{ github.event.inputs.skipBinaries != 'true' }}
uses: ./.github/workflows/linux-precompiled-bin-workflow.yml
secrets: inherit

build-precompiled-bin-windows:
if: ${{ github.event.inputs.skipBinaries != 'true' }}
uses: ./.github/workflows/windows-precompiled-bin-workflow.yml
secrets: inherit
10 changes: 9 additions & 1 deletion scripts/pip-package/package_tar.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ def _get_kuzu_version():
with open(cmake_file) as f:
for line in f:
if line.startswith('project(Kuzu VERSION'):
return line.split(' ')[2].strip()
raw_version = line.split(' ')[2].strip()
version_nums = raw_version.split('.')
if len(version_nums) <= 3:
return raw_version
else:
dev_suffix = version_nums[3]
version = '.'.join(version_nums[:3])
version += ".dev%s" % dev_suffix
return version

if __name__ == "__main__":
if len(sys.argv) == 2:
Expand Down
11 changes: 9 additions & 2 deletions scripts/pip-package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@ def _get_kuzu_version():
with open(cmake_file) as f:
for line in f:
if line.startswith('project(Kuzu VERSION'):
return line.split(' ')[2].strip()

raw_version = line.split(' ')[2].strip()
version_nums = raw_version.split('.')
if len(version_nums) <= 3:
return raw_version
else:
dev_suffix = version_nums[3]
version = '.'.join(version_nums[:3])
version += ".dev%s" % dev_suffix
return version

kuzu_version = _get_kuzu_version()
print("The version of this build is %s" % kuzu_version)
Expand Down