This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
Export Restate release #17
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: Export Restate release | |
on: | |
workflow_dispatch: | |
inputs: | |
restateVersion: | |
description: "Restate version" | |
required: true | |
type: string | |
jobs: | |
prepare-restate-release-export: | |
name: Prepare Restate release export | |
runs-on: ubuntu-latest | |
steps: | |
- name: Verify Restate release exists | |
uses: cardinalby/git-get-release-action@v1 | |
id: restate-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.RESTATE_READ_ACCESS }} | |
with: | |
repo: restatedev/restate | |
draft: false | |
prerelease: false | |
tag: ${{ inputs.restateVersion }} | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
# Cannot use secrets.GITHUB_TOKEN because other workflows would not be triggered by generated tags. | |
# See https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow | |
token: ${{ secrets.RESTATE_DIST_WRITE_ACCESS }} | |
- name: Update Dockerfile to point to new release | |
run: | | |
release_tag=${{ inputs.restateVersion }} | |
if [[ ${release_tag} = v* ]]; then | |
# remove v character | |
release_tag="${release_tag:1}" | |
fi | |
sed -i "s/FROM ghcr.io\/restatedev\/restate:.*$/FROM ghcr.io\/restatedev\/restate:${release_tag}/g" docker/Dockerfile | |
- name: Commit updated Dockerfile and tag release | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
tag: ${{ inputs.restateVersion }} | |
message: Restate distribution release ${{ inputs.restateVersion }} | |
add: ./docker/Dockerfile |