Skip to content

Commit

Permalink
Update release workflow
Browse files Browse the repository at this point in the history
update version

Signed-off-by: Nik Nasr <[email protected]>

Create PR in restate repo

fix sha256sum

Signed-off-by: Nik Nasr <[email protected]>

revert package version

Signed-off-by: Nik Nasr <[email protected]>
  • Loading branch information
nikrooz committed Oct 14, 2024
1 parent 41a63bd commit 1b10fd9
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 7 deletions.
78 changes: 73 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
on:
push:
tags:
- 'v**'
branches: [main]
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: johnnybenson/[email protected]
id: package-json
with:
GITHUB_TOKEN: ${{ secrets.TOKEN_FOR_RESTATE_REPO }}
- run: echo "has-updated -- ${{ steps.package-json.outputs.has-updated }}"
outputs:
has-updated: ${{ steps.package-json.outputs.has-updated }}
version: ${{ steps.package-json.outputs.version }}
release:
runs-on: ubuntu-latest
name: Release
needs: check-version
permissions:
contents: write
name: Release
if: ${{ needs.check-version.outputs.has-updated == 'true' }}
outputs:
upload-url: ${{ steps.create-release.outputs.upload_url }}
version: ${{ needs.check-version.outputs.version }}
tag: v${{ needs.check-version.outputs.version }}
artifact-name: ui-v${{ needs.check-version.outputs.version }}.zip
steps:
- run: echo "has-updated -- ${{ needs.check-version.outputs.has-updated }}"
- uses: pnpm/action-setup@v4
with:
version: 9
Expand All @@ -18,9 +43,52 @@ jobs:
fetch-depth: 0
- run: pnpm install --frozen-lockfile
- run: pnpm nx build web-ui --skip-nx-cache
- run: cd dist/apps/web-ui && zip -r ../../../ui-${{ github.ref_name }}.zip .
- run: cd dist/apps/web-ui && zip -r ../../../ui-v${{ needs.check-version.outputs.version }}.zip .
- name: Create a release
id: create-release
uses: ncipollo/release-action@v1
with:
artifacts: ui-${{ github.ref_name }}.zip
commit: ${{ github.sha }}
makeLatest: true
tag: v${{ needs.check-version.outputs.version }}
artifacts: ui-v${{ needs.check-version.outputs.version }}.zip
generateReleaseNotes: true
update-ui:
name: Update UI in restate repo
runs-on: ubuntu-latest
needs: release
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.TOKEN_FOR_RESTATE_REPO }}
repository: restatedev/restate
- name: Download artifact
uses: dsaltares/fetch-gh-release-asset@master
with:
version: tags/${{ needs.release.outputs.tag }}
file: ${{ needs.release.outputs.artifact-name }}
target: ./crates/web-ui/archive.zip
token: ${{ secrets.TOKEN_FOR_RESTATE_REPO }}
- name: Calculate SHA256 checksum and set as env var
run: |
echo "FILE_SHA256=$(sha256sum ./crates/web-ui/archive.zip | awk '{print $1}')" >> $GITHUB_ENV
shell: bash
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.TOKEN_FOR_RESTATE_REPO }}
draft: true
branch: update-ui-${{needs.release.outputs.tag}}
title: '[Restate UI] Update to ${{ needs.release.outputs.tag }}'
commit-message: |
Version: ${{ needs.release.outputs.tag }}
Release: https://github.com/restatedev/restate-web-ui/releases/tag/${{ needs.release.outputs.tag }}
sha256sum: ${{ env.FILE_SHA256 }}
body: |
- Version: ${{ needs.release.outputs.tag }}
- Release: https://github.com/restatedev/restate-web-ui/releases/tag/${{ needs.release.outputs.tag }}
- sha256sum: ${{ env.FILE_SHA256 }}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ pnpm install
# Run the web ui app in dev mode with mock configuration
pnpm nx serve web-ui --configuration=mock

# Run the web ui app in dev mode against a local restate server
pnpm nx serve web-ui --configuration=local

# Run the ui-button unit tests in watch mode
pnpm nx run test ui-button --watch
```
Expand Down
4 changes: 2 additions & 2 deletions apps/web-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ This application is for Restate Web UI, developed using [`Remix`](https://remix.

```sh
# Run Web UI app in dev mode
pnpm nx serve web-ui -c mock
pnpm nx serve web-ui -c mock|local

# Build Web UI app in prod mode
pnpm nx build web-ui

# Start the Web UI app in prod mode
pnpm nx start web-ui -c mock|dev|prod
pnpm nx start web-ui -c mock|local

# Run unit tests for Web UI app
pnpm nx test web-ui
Expand Down

0 comments on commit 1b10fd9

Please sign in to comment.