Skip to content

Commit

Permalink
Add release workflow for the restate repository
Browse files Browse the repository at this point in the history
The release workflow will be triggered by pushing a version tag. It will
then build a docker file for this version, the binaries of the CLI and
finally creates a release with the binaries attached.

This fixes #347.
  • Loading branch information
tillrohrmann committed Apr 27, 2023
1 parent b3c42b1 commit 1946d75
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CI

on:
pull_request:
workflow_call:
workflow_dispatch:
push:
branches:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Build Docker image

on:
push:
tags:
- v**
workflow_call:
workflow_dispatch:

env:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Create new release

on:
push:
tags:
- v**

jobs:
run-tests:
name: Test release
uses: ./.github/workflows/ci.yml

build-docker-image:
name: Build release Docker image
needs: [run-tests]
uses: ./.github/workflows/docker.yml

build-cli-binaries:
name: Build release cli binaries
needs: [run-tests]
uses: ./.github/workflows/cli.yml

create-release:
name: Create release
runs-on: ubuntu-latest
needs: [build-docker-image, build-cli-binaries]

steps:
- name: Download cli binaries
uses: actions/download-artifact@v3

- name: Package cli binaries
id: package-cli-binaries
run: |
for cli in restate-cli-*; do zip -j ${cli}.zip ${cli}/restate-cli; done
echo "PACKAGES<<EOF" >> $GITHUB_OUTPUT
ls -1 restate-cli-*.zip >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create release
uses: softprops/action-gh-release@v1
with:
# create a draft release which needs manual approval
draft: true
files: ${{ steps.package-cli-binaries.outputs.PACKAGES }}

4 changes: 3 additions & 1 deletion docs/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ This directory contains documentation relevant for Restate developers.

[rust-guidelines.md](rust-guidelines.md) contains guidelines for coding Rust.

[debug.md](debug.md) contains some tips for debugging the runtime.
[debug.md](debug.md) contains some tips for debugging the runtime.

[release.md](release.md) contains explanation for how to release the runtime.
11 changes: 11 additions & 0 deletions docs/dev/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Releasing the Restate runtime

In order to release the Restate runtime, you have to create a tag of the form `vX.Y.Z` and push it to the repository.
The tag will trigger the [release.yml](/.github/workflows/release.yml) workflow which does the following:

* Running the local tests
* Creating and pushing the Docker image with the runtime
* Creating the CLI binaries
* Creating a draft release with the CLI binaries attached

In order to finish the release, you have to publish it [here](https://github.com/restatedev/restate/releases).

0 comments on commit 1946d75

Please sign in to comment.