diff --git a/.github/workflows/sdk-python.yml b/.github/workflows/sdk-python.yml index fe9800ae6..4ae199a2e 100644 --- a/.github/workflows/sdk-python.yml +++ b/.github/workflows/sdk-python.yml @@ -11,7 +11,7 @@ on: branches: - main paths: - - 'sdks/python/pyproject.toml' + - 'sdks/python/**' defaults: run: @@ -171,6 +171,14 @@ jobs: - name: Run publish.sh script run: | + CURRENT_PYPI_VERSION=$(pip index versions hatchet-sdk | awk 'NR==1 {gsub(/[()]/,"",$2); print $2}') + NEW_VERSION=$(cat pyproject.toml| grep "^version =" | cut -d '"' -f 2) + + if [ "$CURRENT_PYPI_VERSION" == "$NEW_VERSION" ]; then + echo "Version has not changed. Skipping publish." + exit 0 + fi + sh publish.sh env: POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }} diff --git a/.github/workflows/sdk-typescript.yml b/.github/workflows/sdk-typescript.yml index f884bf747..afe9a2a87 100644 --- a/.github/workflows/sdk-typescript.yml +++ b/.github/workflows/sdk-typescript.yml @@ -11,7 +11,7 @@ on: branches: - main paths: - - 'sdks/typescript/package.json' + - 'sdks/typescript/**' defaults: run: @@ -200,6 +200,12 @@ jobs: - name: Build and Publish SDK run: | VERSION=$(jq '.version' package.json) + CURRENT_NPM_VERSION=$(pnpm view @hatchet-dev/typescript-sdk version) + + if [[ "$VERSION" == "$CURRENT_NPM_VERSION" ]]; then + echo "Version has not changed. Skipping publish." + exit 0 + fi ## If the version contains `alpha`, it's an alpha version ## and we should tag it as such.= diff --git a/sdks/typescript/src/v1/examples/durable-sleep/workflow.ts b/sdks/typescript/src/v1/examples/durable-sleep/workflow.ts index 59da2fbf5..c661cfee6 100644 --- a/sdks/typescript/src/v1/examples/durable-sleep/workflow.ts +++ b/sdks/typescript/src/v1/examples/durable-sleep/workflow.ts @@ -25,6 +25,7 @@ durableSleep.durableTask({ } ) ); + console.log('res', res); return { Value: 'done',