-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Moved the variables with version in a separate json file, so it's easy to automate changes on it. * Add scripts to update variables and schemas * Fix the docker image building
- Loading branch information
1 parent
41cb86e
commit 9a832bf
Showing
10 changed files
with
231 additions
and
29 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,32 @@ | ||
name: "Install protoc" | ||
description: "Installs protoc for the given os" | ||
inputs: | ||
protoc-version: | ||
description: "protoc version" | ||
required: false | ||
default: "21.12" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install protoc for ${{ runner.os }} | ||
env: | ||
LINK: https://github.com/protocolbuffers/protobuf/releases/download | ||
PROTOC_VERSION: ${{ inputs.protoc-version }} | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-x86_64.zip | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
PROTOC_ZIP=protoc-$PROTOC_VERSION-osx-x86_64.zip | ||
else | ||
echo "$RUNNER_OS not supported" | ||
exit 1 | ||
fi | ||
curl -OL $LINK/v$PROTOC_VERSION/$PROTOC_ZIP | ||
unzip -o $PROTOC_ZIP -d $HOME/.local bin/protoc | ||
unzip -o $PROTOC_ZIP -d $HOME/.local 'include/*' | ||
rm -f $PROTOC_ZIP | ||
echo "$HOME/.local" >> $GITHUB_PATH | ||
chmod +x $HOME/.local/bin/protoc | ||
echo "PROTOC=$HOME/.local/bin/protoc" >> $GITHUB_ENV | ||
echo "PROTOC_INCLUDE=$HOME/.local/include" >> $GITHUB_ENV | ||
shell: bash |
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 |
---|---|---|
@@ -1,11 +1,66 @@ | ||
name: Build docker image | ||
name: Build Docker image | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: 'ghcr.io' | ||
REPOSITORY: ${{ github.repository_owner }} | ||
REGISTRY_USERNAME: ${{ github.actor }} | ||
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
build-docker-image: | ||
name: Build docker image | ||
uses: restatedev/restate/.github/workflows/docker.yml@main | ||
secrets: inherit | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Setup caching | ||
- name: Set up QEMU dependency | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ env.REGISTRY_USERNAME }} | ||
password: ${{ env.REGISTRY_TOKEN }} | ||
|
||
- name: Extract image name | ||
# Set repository name as image name | ||
run: | | ||
echo "IMAGE_NAME=${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/}" >> $GITHUB_ENV | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }} | ||
# Note: We need this to generate the latest tag until we have a first stable release. | ||
# Check https://github.com/docker/metadata-action/issues/34 | ||
flavor: | | ||
latest=true | ||
tags: | | ||
type=ref,event=branch | ||
type=semver,pattern={{version}} | ||
- name: Build and Push Docker image | ||
id: build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: "docker/Dockerfile" | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
load: false | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: "linux/arm64,linux/amd64" | ||
cache-from: type=gha,scope=${{ github.workflow }} | ||
cache-to: type=gha,mode=max,scope=${{ github.workflow }} |
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,79 @@ | ||
name: Pre-release updates | ||
|
||
on: | ||
workflow_dispatch: | ||
restateVersion: | ||
description: 'Restate version (without prepending v). The Restate repository must have the tag already!' | ||
required: true | ||
type: string | ||
sdkTypescriptVersion: | ||
description: 'sdk-typescript version (without prepending v).' | ||
required: true | ||
type: string | ||
tourVersion: | ||
description: 'tour version (without prepending v).' | ||
required: true | ||
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 | ||
with: | ||
repository: restatedev/restate | ||
ref: v${{ inputs.restateVersion }} | ||
token: ${{ secrets.E2E_CONTENTS_READ_TOKEN }} | ||
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 }} | ||
|
||
# Update the doc config file | ||
- name: Update restate.config.json with new runtime version | ||
uses: jossef/[email protected] | ||
with: | ||
file: restate.config.json | ||
field: RESTATE_DIST_VERSION | ||
value: ${{ inputs.restateVersion }} | ||
- name: Update restate.config.json with new sdk version | ||
uses: jossef/[email protected] | ||
with: | ||
file: restate.config.json | ||
field: TYPESCRIPT_SDK_VERSION | ||
value: ${{ inputs.sdkTypescriptVersion }} | ||
- name: Update restate.config.json with new tour version | ||
uses: jossef/[email protected] | ||
with: | ||
file: restate.config.json | ||
field: TOUR_VERSION | ||
value: ${{ inputs.tourVersion }} | ||
|
||
- name: Run the runtime generate script | ||
run: | | ||
./tools/generate.sh temp-restate | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
title: "[GithubActions] Update Restate '${{ inputs.restateVersion }}' SDK-Typescript '${{ inputs.sdkTypescriptVersion }}' Tour '${{ inputs.tourVersion }}'" | ||
commit-message: "[GithubActions] Update Restate '${{ inputs.restateVersion }}' SDK-Typescript '${{ inputs.sdkTypescriptVersion }}' Tour '${{ inputs.tourVersion }}'" | ||
add-paths: | | ||
restate.config.json | ||
static/schemas/* | ||
docs/references/* |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Create new release | ||
name: Release on tag | ||
|
||
on: | ||
push: | ||
|
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,25 @@ | ||
name: Trigger release | ||
|
||
on: | ||
workflow_dispatch: | ||
version: | ||
description: 'Documentation version (without prepending v).' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
sync-branch: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: production | ||
|
||
- name: Merge main -> production and tag it | ||
run: | | ||
git --version | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git merge main | ||
git tag v${{ inputs.version }} | ||
git push --follow-tags |
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 |
---|---|---|
|
@@ -45,7 +45,7 @@ This guide is written for: | |
### Setting up the tutorial | ||
Clone the GitHub repository of the [tutorial](https://github.com/restatedev/tour-of-restate-typescript): | ||
```shell | ||
git clone --depth 1 --branch VAR::TOUR_VERSION [email protected]:restatedev/tour-of-restate-typescript.git | ||
git clone --depth 1 --branch vVAR::TOUR_VERSION [email protected]:restatedev/tour-of-restate-typescript.git | ||
``` | ||
|
||
This GitHub repository contains the basic skeleton of the NodeJS/Typescript services that you develop in this tutorial. | ||
|
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,5 @@ | ||
{ | ||
"RESTATE_DIST_VERSION": "0.3.0", | ||
"TYPESCRIPT_SDK_VERSION": "0.3.1", | ||
"TOUR_VERSION": "0.3.2" | ||
} |
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