-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Now releasing examples follows a similar flow to the documentation repo * There is a pre-release workflow that performs all the sdk updates * Then the release workflow zips the sdk-java and typescript lambda greeter examples, and adds them to the GH release artifacts
- Loading branch information
1 parent
e379a07
commit 3eb6025
Showing
5 changed files
with
177 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Pre-release updates | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
sdkTypescriptVersion: | ||
description: 'sdk-typescript version (without prepending v). Leave empty if you don't need to update it.' | ||
required: false | ||
type: string | ||
sdkJavaVersion: | ||
description: 'sdk-java version (without prepending v). Leave empty if you don't need to update it.' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
updates: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
# Setup node | ||
- uses: actions/setup-node@v3 | ||
if: github.event.inputs.sdkTypescriptVersion != '' | ||
with: | ||
node-version: "19.x" | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
# Bump sdk version in node examples and run checks | ||
- name: Run npm updates | ||
if: github.event.inputs.sdkTypescriptVersion != '' | ||
run: npm --prefix typescript install @restatedev/restate-sdk@^${{ inputs.sdkTypescriptVersion }} --workspaces | ||
- name: Check npm examples compile correctly | ||
if: github.event.inputs.sdkTypescriptVersion != '' | ||
run: npm --prefix typescript run verify --workspaces | ||
|
||
# Setup Java | ||
- uses: actions/setup-java@v3 | ||
if: github.event.inputs.sdkJavaVersion != '' | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
# Bump sdk version in java examples and run checks | ||
- name: Find and replace restateVersion in build.gradle.kts | ||
if: github.event.inputs.sdkJavaVersion != '' | ||
run: for jvmDir in java-blocking-http java-blocking-lambda kotlin-http kotlin-lambda; do sed -i 's/val restateVersion = "[0-9A-Z.-]*"/val restateVersion = "${{ inputs.sdkJavaVersion }}"/' jvm/$jvmDir/build.gradle.kts; done | ||
- name: Test jvm/java-blocking-http | ||
if: github.event.inputs.sdkJavaVersion != '' | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: check | ||
build-root-directory: jvm/java-blocking-http | ||
- name: Test jvm/java-blocking-lambda | ||
if: github.event.inputs.sdkJavaVersion != '' | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: check | ||
build-root-directory: jvm/java-blocking-lambda | ||
- name: Test jvm/kotlin-http | ||
if: github.event.inputs.sdkJavaVersion != '' | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: check | ||
build-root-directory: jvm/kotlin-http | ||
- name: Test jvm/kotlin-lambda | ||
if: github.event.inputs.sdkJavaVersion != '' | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: check | ||
build-root-directory: jvm/kotlin-lambda | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
title: "[GithubActions] Update Restate SDK-Typescript '${{ inputs.sdkTypescriptVersion }}' SDK-Java '${{ inputs.sdkJavaVersion }}'" | ||
commit-message: "[GithubActions] Update Restate SDK-Typescript '${{ inputs.sdkTypescriptVersion }}' SDK-Java '${{ inputs.sdkJavaVersion }}'" | ||
add-paths: | | ||
**/package.json | ||
**/package-lock.json | ||
**/build.gradle.kts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Create new release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v** | ||
|
||
jobs: | ||
publish-release: | ||
name: Publish release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Prepare zip files | ||
run: ./scripts/prepare_examples_zip.sh | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
# create a draft release which needs manual approval | ||
draft: true | ||
files: | | ||
typescript-lambda-greeter.zip | ||
jvm-java-blocking-http.zip | ||
jvm-java-blocking-lambda.zip | ||
jvm-kotlin-http.zip | ||
jvm-kotlin-lambda.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
OUT_DIR="$(pwd)" | ||
|
||
zip_ts_example() { | ||
pushd typescript && zip -r typescript-$1.zip $1 -x '*node_modules*' '*dist*' && popd || exit | ||
mv typescript/typescript-$1.zip $OUT_DIR | ||
echo "Zip for $1 in $OUT_DIR/typescript-$1.zip" | ||
} | ||
|
||
zip_jvm_example() { | ||
pushd jvm && zip -r jvm-$1.zip $1 -x '*.gradle*' '*build*' '*.idea*' && popd || exit | ||
mv jvm/jvm-$1.zip $OUT_DIR | ||
echo "Zip for $1 in $OUT_DIR/jvm-$1.zip" | ||
} | ||
|
||
zip_ts_example lambda-greeter | ||
|
||
zip_jvm_example java-blocking-http | ||
zip_jvm_example java-blocking-lambda | ||
zip_jvm_example kotlin-http | ||
zip_jvm_example kotlin-lambda |