Skip to content

Commit

Permalink
Bump all Node SDK versions + fix automated bump scripts (#165)
Browse files Browse the repository at this point in the history
* Make sure we correctly bump the TS sdk version where needed

Signed-off-by: slinkydeveloper <[email protected]>

* Add script to bump restate version for npm artifacts.

Signed-off-by: slinkydeveloper <[email protected]>

* Do all the bumps

Signed-off-by: slinkydeveloper <[email protected]>

---------

Signed-off-by: slinkydeveloper <[email protected]>
  • Loading branch information
slinkydeveloper authored Jul 17, 2024
1 parent b159456 commit 259e0b7
Show file tree
Hide file tree
Showing 21 changed files with 103 additions and 45 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Pre-release updates
on:
workflow_dispatch:
inputs:
restateVersion:
description: 'Restate runtime version (without prepending v). Leave empty if you do not want to update it.'
required: false
type: string
sdkTypescriptVersion:
description: 'sdk-typescript version (without prepending v). Leave empty if you do not want to update it.'
required: false
Expand All @@ -27,6 +31,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Bump Restate
if: github.event.inputs.restateVersion != ''
run: ./.tools/update_restate.sh ${{ inputs.restateVersion }}

# Bump Typescript SDK
- uses: actions/setup-node@v3
if: github.event.inputs.sdkTypescriptVersion != ''
Expand Down Expand Up @@ -62,8 +70,8 @@ jobs:
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: "[GithubActions] Update Restate ${{ inputs.sdkTypescriptVersion != '' && format('SDK-Typescript {0} ', inputs.sdkTypescriptVersion) }}${{ inputs.sdkJavaVersion != '' && format('SDK-Java {0} ', inputs.sdkJavaVersion) }}${{ inputs.cdkVersion != '' && format('CDK {0} ', inputs.cdkVersion) }}"
commit-message: "[GithubActions] Update Restate ${{ inputs.sdkTypescriptVersion != '' && format('SDK-Typescript {0} ', inputs.sdkTypescriptVersion) }}${{ inputs.sdkJavaVersion != '' && format('SDK-Java {0} ', inputs.sdkJavaVersion) }}${{ inputs.cdkVersion != '' && format('CDK {0} ', inputs.cdkVersion) }}"
title: "[GithubActions] Update Restate ${{ inputs.restateVersion != '' && format('Runtime {0} ', inputs.restateVersion) }}${{ inputs.sdkTypescriptVersion != '' && format('SDK-Typescript {0} ', inputs.sdkTypescriptVersion) }}${{ inputs.sdkJavaVersion != '' && format('SDK-Java {0} ', inputs.sdkJavaVersion) }}${{ inputs.cdkVersion != '' && format('CDK {0} ', inputs.cdkVersion) }}"
commit-message: "[GithubActions] Update Restate ${{ inputs.restateVersion != '' && format('Runtime {0} ', inputs.restateVersion) }}${{ inputs.sdkTypescriptVersion != '' && format('SDK-Typescript {0} ', inputs.sdkTypescriptVersion) }}${{ inputs.sdkJavaVersion != '' && format('SDK-Java {0} ', inputs.sdkJavaVersion) }}${{ inputs.cdkVersion != '' && format('CDK {0} ', inputs.cdkVersion) }}"
add-paths: |
**/package.json
**/package-lock.json
Expand Down
2 changes: 2 additions & 0 deletions .tools/update_node_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function bump_ts_sdk_clients() {
}

bump_ts_sdk $PROJECT_ROOT/basics/basics-typescript
bump_ts_sdk_clients $PROJECT_ROOT/basics/basics-typescript

bump_ts_sdk $PROJECT_ROOT/templates/typescript
bump_ts_sdk $PROJECT_ROOT/templates/typescript-lambda-cdk
Expand All @@ -37,3 +38,4 @@ bump_ts_sdk $PROJECT_ROOT/patterns-use-cases/ticket-reservation/ticket-reservati

bump_ts_sdk $PROJECT_ROOT/end-to-end-applications/typescript/ai-image-workflows
bump_ts_sdk $PROJECT_ROOT/end-to-end-applications/typescript/food-ordering/app
bump_ts_sdk_clients $PROJECT_ROOT/end-to-end-applications/typescript/food-ordering/webui
28 changes: 28 additions & 0 deletions .tools/update_restate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

NEW_VERSION=$1
SELF_PATH=${BASH_SOURCE[0]:-"$(command -v -- "$0")"}
PROJECT_ROOT="$(dirname "$SELF_PATH")/.."

function bump_npm_restate() {
npm --prefix $1 install @restatedev/restate@^$NEW_VERSION
}

function bump_npm_restate_cli() {
npm --prefix $1 install @restatedev/restate-server@^$NEW_VERSION
}

bump_npm_restate $PROJECT_ROOT/basics/basics-typescript
bump_npm_restate_cli $PROJECT_ROOT/basics/basics-typescript

bump_npm_restate $PROJECT_ROOT/patterns-use-cases/async-signals-payment/async-signals-payment-typescript
bump_npm_restate_cli $PROJECT_ROOT/patterns-use-cases/async-signals-payment/async-signals-payment-typescript

bump_npm_restate $PROJECT_ROOT/patterns-use-cases/durable-promises/durable-promises-typescript
bump_npm_restate_cli $PROJECT_ROOT/patterns-use-cases/durable-promises/durable-promises-typescript

bump_npm_restate $PROJECT_ROOT/patterns-use-cases/state-machines/state-machines-typescript
bump_npm_restate_cli $PROJECT_ROOT/patterns-use-cases/state-machines/state-machines-typescript

bump_npm_restate $PROJECT_ROOT/patterns-use-cases/ticket-reservation/ticket-reservation-typescript
bump_npm_restate_cli $PROJECT_ROOT/patterns-use-cases/ticket-reservation/ticket-reservation-typescript
8 changes: 4 additions & 4 deletions basics/basics-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"example-6": "ts-node-dev --transpile-only src/6_events_state.ts"
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0",
"@restatedev/restate-sdk-clients": "^1.0.0"
"@restatedev/restate-sdk": "^1.1.1",
"@restatedev/restate-sdk-clients": "^1.1.1"
},
"devDependencies": {
"@restatedev/restate": "^0.9.2",
"@restatedev/restate-server": "^0.9.2",
"@restatedev/restate": "^1.0.2",
"@restatedev/restate-server": "^1.0.2",
"@types/node": "^20.12.12",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"workflow-service": "ts-node-dev --watch ./src --respawn --transpile-only src/workflow/workflow.ts"
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0",
"@restatedev/restate-sdk": "^1.1.1",
"axios": "^1.6.7",
"axios-retry": "^4.0.0",
"express": "^4.18.2",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"app-dev": "RESTATE_DEBUG_LOGGING=JOURNAL ts-node-dev --watch src --respawn --transpile-only src/order-app/app.ts"
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0",
"@restatedev/restate-sdk": "^1.1.1",
"@types/node": "^20.6.3",
"@types/uuid": "^9.0.0",
"axios": "^1.4.0",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"node": "14.17.3"
},
"dependencies": {
"@restatedev/restate-sdk-clients": "^1.1.1",
"axios": "^0.26.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
Expand All @@ -15,8 +16,7 @@
"styled-components": "^5.3.3",
"typescript": "^4.6.3",
"unique-names-generator": "^4.7.1",
"uuid": "^8.3.2",
"@restatedev/restate-sdk-clients": "dev"
"uuid": "^8.3.2"
},
"proxy": "http://localhost:3000/",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"app-dev": "ts-node-dev --watch ./src --transpile-only ./src/payment_handler.ts"
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0",
"@restatedev/restate-sdk": "^1.1.1",
"stripe": "^14.15.0"
},
"devDependencies": {
"@restatedev/restate": "^0.9.2",
"@restatedev/restate-server": "^0.9.2",
"@restatedev/restate": "^1.0.2",
"@restatedev/restate-server": "^1.0.2",
"@types/node": "^20.12.12",
"ts-node-dev": "^1.1.1",
"typescript": "^5.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"example3": "ts-node --transpile-only ./src/3_example_parallel_processes.ts"
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0",
"@restatedev/restate-sdk-clients": "^1.1.0"
"@restatedev/restate-sdk": "^1.1.1",
"@restatedev/restate-sdk-clients": "^1.1.1"
},
"devDependencies": {
"@restatedev/restate": "^0.9.2",
"@restatedev/restate-server": "^0.9.2",
"@restatedev/restate": "^1.0.2",
"@restatedev/restate-server": "^1.0.2",
"@types/node": "^20.12.7",
"ts-node": "^10.9.2",
"typescript": "^5.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"app-dev": "ts-node-dev --watch ./src --transpile-only ./src/payment_service.ts"
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0"
"@restatedev/restate-sdk": "^1.1.1"
},
"devDependencies": {
"@types/node": "^20.12.7",
Expand Down
2 changes: 1 addition & 1 deletion patterns-use-cases/sagas/sagas-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "tsc --noEmitOnError"
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0"
"@restatedev/restate-sdk": "^1.1.1"
},
"devDependencies": {
"@types/node": "^20.12.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"example-crash": "CRASH_PROCESS=true ./utils/restart-process.sh 'RESTATE_DEBUG_LOGGING=OFF ts-node-dev --transpile-only src/state_machine.ts'"
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0"
"@restatedev/restate-sdk": "^1.1.1"
},
"devDependencies": {
"@restatedev/restate": "^0.9.2",
"@restatedev/restate-server": "^0.9.2",
"@restatedev/restate": "^1.0.2",
"@restatedev/restate-server": "^1.0.2",
"@types/node": "^20.12.7",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
"dev": "ts-node-dev --respawn --transpile-only ./src/app.ts"
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0"
"@restatedev/restate-sdk": "^1.1.1"
},
"devDependencies": {
"@restatedev/restate": "^0.9.2",
"@restatedev/restate": "^1.0.2",
"@restatedev/restate-server": "^1.0.2",
"@types/node": "^20.12.7",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
Expand Down
2 changes: 1 addition & 1 deletion templates/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"format": "prettier --write \"src/*.+(js|ts|json)\""
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0"
"@restatedev/restate-sdk": "^1.1.1"
},
"devDependencies": {
"@types/bun": "^1.1.5",
Expand Down
2 changes: 1 addition & 1 deletion templates/cloudflare-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"format": "prettier --write \"src/*.+(js|ts|json)\""
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0"
"@restatedev/restate-sdk": "^1.1.1"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240605.0",
Expand Down
2 changes: 1 addition & 1 deletion templates/deno/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Context, endpoint, service } from "npm:@restatedev/restate-sdk@^1.0.1/fetch";
import { Context, endpoint, service } from "npm:@restatedev/restate-sdk@^1.1.1/fetch";

// Template of a Restate service and handler
//
Expand Down
2 changes: 1 addition & 1 deletion templates/typescript-lambda-cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"typescript": "^5.4.5"
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0",
"@restatedev/restate-sdk": "^1.1.1",
"aws-cdk-lib": "^2.145.0",
"constructs": "^10.3.0",
"source-map-support": "^0.5.21"
Expand Down
2 changes: 1 addition & 1 deletion templates/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"app-dev": "ts-node-dev --watch ./src --respawn --transpile-only ./src/app.ts"
},
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0"
"@restatedev/restate-sdk": "^1.1.1"
},
"devDependencies": {
"@types/node": "^20.14.2",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/tour-of-restate-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"author": "Restate Developers",
"email": "[email protected]",
"dependencies": {
"@restatedev/restate-sdk": "^1.1.0",
"@restatedev/restate-sdk": "^1.1.1",
"uuid": "^9.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit 259e0b7

Please sign in to comment.