Skip to content
Open
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
9 changes: 9 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
# pull_request:
# branches:
# - master
workflow_dispatch:
release:
types:
- created
Expand Down Expand Up @@ -128,12 +129,14 @@ jobs:
PYAPP_REPO: pyapp
PYAPP_VERSION: v0.27.0
PYAPP_PYTHON_VERSION: "3.12"
PYAPP_PROJECT_NAME: "dma"

# CRITICAL: Correct offline configuration (NO PYAPP_UV_ENABLED)
PYAPP_DISTRIBUTION_EMBED: "true"
PYAPP_FULL_ISOLATION: "true"
PYAPP_SKIP_INSTALL: "true" # Project already embedded
PYAPP_PROJECT_FEATURES: "oracle,postgres,mssql,mysql,server"
PYAPP_DISTRIBUTION_VARIANT_CPU: "v1"
steps:
- name: Checkout code
uses: actions/checkout@v6
Expand Down Expand Up @@ -178,10 +181,16 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
shell: bash

- name: Generate requirements.txt
run: |
uv export --frozen --no-dev --no-editable --no-hashes --no-header --no-emit-project --extra postgres --extra server > dist/requirements.txt
echo "${{ github.workspace }}/dist/dma-${{ steps.version.outputs.VERSION }}-py3-none-any.whl" >> dist/requirements.txt

- name: Build PyApp binary
working-directory: ${{ env.PYAPP_REPO }}
env:
PYAPP_PROJECT_PATH: ${{ github.workspace }}/dist/dma-${{ steps.version.outputs.VERSION }}-py3-none-any.whl
PYAPP_PROJECT_DEPENDENCY_FILE: ${{ github.workspace }}/dist/requirements.txt
run: cargo build --release --target ${{ matrix.job.target }}

- name: Rename binary (Unix)
Expand Down
15 changes: 8 additions & 7 deletions tools/build-binary-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,31 @@
# limitations under the License.
# shellcheck disable=SC2086
set -euxo pipefail
current_version=$(hatch version)
current_version=$(uv run python -c "from dma.__about__ import __version__; print(__version__)")


export HATCH_BUILD_LOCATION="dist"
export CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG="true"
# export CARGO_BUILD_TARGET="x86_64-unknown-linux-gnu"
export RUST_BACKTRACE="full"
export PYAPP_VERSION="v0.27.0"
export PYAPP_VERSION="v0.29.0"
export PYAPP_REPO="dist/.scratch"
export PYAPP_PROJECT_PATH="$(realpath dist/dma-${current_version}-py3-none-any.whl)"
export PYAPP_PROJECT_NAME="dma"
export PYAPP_PROJECT_VERSION="${current_version}"
export PYAPP_PROJECT_DEPENDENCY_FILE="$(realpath dist/requirements.txt)"
export PYAPP_PYTHON_VERSION="3.12"
export PYAPP_PROJECT_FEATURES="postgres"
export PYAPP_DISTRIBUTION_VARIANT="v1"
export PYAPP_PROJECT_FEATURES="server,postgres"
export PYAPP_DISTRIBUTION_VARIANT_CPU="v1"
export PYAPP_UV_ENABLED="true"
export PYAPP_FULL_ISOLATION="true"
export PYAPP_DISTRIBUTION_EMBED="true"
rm -Rf dist/.scratch
git clone --quiet --depth 1 --branch $PYAPP_VERSION https://github.com/ofek/pyapp dist/.scratch

hatch build
hatch dep show requirements --project-only > dist/requirements.txt
hatch dep show requirements -p -f postgres -f server >> dist/requirements.txt
uv build
uv export --frozen --no-dev --no-editable --no-hashes --no-header --no-emit-project --extra postgres --extra server > dist/requirements.txt
echo "$(realpath dist/dma-${current_version}-py3-none-any.whl)" >> dist/requirements.txt
cd dist/.scratch && cargo build --release && cd -
cp dist/.scratch/target/release/pyapp dist/dma
chmod +x dist/dma