Pre-release updates #9
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
name: Pre-release updates | |
on: | |
workflow_dispatch: | |
inputs: | |
restateVersion: | |
description: "Restate version (without prepending v). The Restate repository must have the tag already!" | |
required: false | |
type: string | |
sdkTypescriptVersion: | |
description: "sdk-typescript version (without prepending v)." | |
required: false | |
type: string | |
sdkJavaVersion: | |
description: 'sdk-java version (without prepending v).' | |
required: false | |
type: string | |
tourVersion: | |
description: "Typescript+Java tour version (without prepending v)." | |
required: false | |
type: string | |
jobs: | |
updates: | |
runs-on: ubuntu-latest | |
timeout-minutes: 45 | |
steps: | |
- name: Checkout documentation | |
uses: actions/checkout@v3 | |
- name: Checkout Restate | |
uses: actions/checkout@v3 | |
if: ${{ inputs.restateVersion != '' }} | |
with: | |
repository: restatedev/restate | |
ref: v${{ inputs.restateVersion }} | |
path: temp-restate | |
# We need rust, protoc and just to compile the runtime to generate the docs | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Install protoc | |
uses: ./.github/actions/install-protoc | |
- name: Setup just | |
uses: extractions/setup-just@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run the runtime generate script | |
if: ${{ inputs.restateVersion != '' }} | |
run: | | |
./tools/generate.sh temp-restate | |
- name: Parse Restate version | |
id: semver_parser | |
uses: booxmedialtd/ws-action-parse-semver@v1 | |
if: ${{ inputs.restateVersion != '' }} | |
with: | |
input_string: ${{ inputs.restateVersion }} | |
# Update the doc config file | |
- name: Update restate.config.json with new runtime version | |
uses: jossef/[email protected] | |
if: ${{ inputs.restateVersion != '' }} | |
with: | |
file: restate.config.json | |
field: RESTATE_VERSION | |
# Drop patch version to generate major.minor format | |
value: ${{ format('{0}.{1}', steps.semver_parser.outputs.major, steps.semver_parser.outputs.minor) }} | |
- name: Update restate.config.json with new TS sdk version | |
uses: jossef/[email protected] | |
if: ${{ inputs.sdkTypescriptVersion != '' }} | |
with: | |
file: restate.config.json | |
field: TYPESCRIPT_SDK_VERSION | |
value: ${{ inputs.sdkTypescriptVersion }} | |
- name: Update restate.config.json with new tour version (Typescript + Java) | |
uses: jossef/[email protected] | |
if: ${{ inputs.tourVersion != '' }} | |
with: | |
file: restate.config.json | |
field: TOUR_VERSION | |
value: ${{ inputs.tourVersion }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
title: "[GithubActions] Update documentation ${{ inputs.restateVersion != '' && format('Restate {0}, ', inputs.restateVersion) }}${{ inputs.sdkTypescriptVersion != '' && format('SDK-Typescript {0}, ', inputs.sdkTypescriptVersion) }}${{ inputs.sdkJavaVersion != '' && format('SDK-Java {0}, ', inputs.sdkJavaVersion) }}${{ inputs.tourVersion != '' && format('Tour {0}', inputs.tourVersion) }}" | |
commit-message: "Update documentation: ${{ inputs.restateVersion != '' && format('\n* Bump Restate to {0}', inputs.restateVersion) }}${{ inputs.sdkTypescriptVersion != '' && format('\n* Bump SDK-Typescript to {0} ', inputs.sdkTypescriptVersion) }}${{ inputs.sdkJavaVersion != '' && format('\n* Bump SDK-Java to {0} ', inputs.sdkJavaVersion) }}${{ inputs.tourVersion != '' && format('\n* Bump Tour of Restate to {0}', inputs.tourVersion) }}" | |
add-paths: | | |
restate.config.json | |
static/schemas/* | |
docs/references/* |