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

New release process #43

Closed
wants to merge 1 commit into from
Closed
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
83 changes: 83 additions & 0 deletions .github/workflows/pre-release.yml
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 do not want to update it.'
required: false
type: string
sdkJavaVersion:
description: 'sdk-java version (without prepending v). Leave empty if you do not want 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
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
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
slinkydeveloper marked this conversation as resolved.
Show resolved Hide resolved
jvm-kotlin-http.zip
jvm-kotlin-lambda.zip
41 changes: 40 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,44 @@ on:
branches: [ main ]

jobs:
build:
build-jvm:
# prevent from running on forks
if: github.repository_owner == 'restatedev'
runs-on: ubuntu-latest
strategy:
matrix:
jvm-version: [ 17 ]

steps:
- uses: actions/checkout@v3

- name: Use JVM ${{ matrix.jvm-version }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.jvm-version }}

- name: Test jvm/java-blocking-http
uses: gradle/gradle-build-action@v2
with:
arguments: check
build-root-directory: jvm/java-blocking-http
- name: Test jvm/java-blocking-lambda
uses: gradle/gradle-build-action@v2
with:
arguments: check
build-root-directory: jvm/java-blocking-lambda
- name: Test jvm/kotlin-http
uses: gradle/gradle-build-action@v2
with:
arguments: check
build-root-directory: jvm/kotlin-http
- name: Test jvm/kotlin-lambda
uses: gradle/gradle-build-action@v2
with:
arguments: check
build-root-directory: jvm/kotlin-lambda
build-ts:
# prevent from running on forks
if: github.repository_owner == 'restatedev'
runs-on: ubuntu-latest
Expand All @@ -17,11 +54,13 @@ jobs:

steps:
- uses: actions/checkout@v3

- uses: bufbuild/buf-setup-action@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'

- run: npm ci --prefix typescript
- run: npm run --prefix typescript -ws verify
30 changes: 3 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ Browse this repository to see how easy distributed applications development beco
If you want to join the Restate community in order to stay up to date, then please join our [Discord](https://discord.gg/skW3AZ6uGd).
The Discord server is also the perfect place for sharing your feedback with us, learning more about Restate and connect with others!

## Running the examples

> **Note**
> Make sure you have [signed up for Restate's private beta](https://forms.gle/G8kDuucqhBoTfMwLA) and set up [access to Restate's packages](https://github.com/restatedev/restate-dist).

### Launching the runtime

Have a look at how to start up the runtime in a Docker container in [this repository]* or run the following commands:
Expand Down Expand Up @@ -77,27 +72,8 @@ This should give you the following output in case of the ticket reservation exam

## Releasing (for Restate developers)

In order to create a new release, push a tag of the form `vX.Y.Z`.
Then [create a release via GitHub](https://github.com/restatedev/example-lambda-ts-greeter/releases).

### Upgrading the SDK dependency (for Restate developers)

In order to upgrade/update the SDK dependency you have to run:

**Major version** change:

```shell
npm --prefix typescript install @restatedev/restate-sdk@^Z.Y.X --workspaces
```

**Minor/patch version** change:
Before releasing, trigger the "pre-release" workflow to update sdk versions. This automatically creates a pull request, which must be manually merged.

```shell
npm --prefix typescript update @restatedev/restate-sdk --workspaces
```
Once the repo is ready for the release, push a tag of the form `vX.Y.Z`.

Now check whether the examples are still building:

```shell
npm --prefix typescript run verify --workspaces
```
This triggers a workflow that [creates a draft release](https://github.com/restatedev/examples/releases) on Github, which you need to approve to finalize it.
22 changes: 22 additions & 0 deletions scripts/prepare_examples_zip.sh
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
Loading