Query Dialog (#79) #36
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
on: | |
push: | |
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 | |
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 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
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-v${{ needs.check-version.outputs.version }}.zip . | |
- name: Create a release | |
id: create-release | |
uses: ncipollo/release-action@v1 | |
with: | |
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: Remove old artifacts | |
run: rm -f ./crates/web-ui/assets/*.zip | |
- 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/assets/${{ needs.release.outputs.artifact-name }} | |
token: ${{ secrets.TOKEN_FOR_RESTATE_REPO }} | |
- name: Calculate SHA256 checksum and set as env var | |
run: | | |
echo "FILE_SHA256=$(sha256sum ./crates/web-ui/assets/${{ needs.release.outputs.artifact-name }} | 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 }} | |
branch: update-ui-${{needs.release.outputs.tag}} | |
title: '[Restate UI] Update to ${{ needs.release.outputs.tag }}' | |
sign-commits: true | |
commit-message: | | |
[UI] Updating UI assets to ${{ needs.release.outputs.tag }} | |
${{ needs.release.outputs.artifact-name }} published at https://github.com/restatedev/restate-web-ui/releases/download/${{ needs.release.outputs.tag }}/${{ needs.release.outputs.artifact-name }} | |
sha256: ${{ env.FILE_SHA256 }} | |
body: | | |
### [UI] Updating UI assets to ${{ needs.release.outputs.tag }} | |
${{ needs.release.outputs.artifact-name }} published at https://github.com/restatedev/restate-web-ui/releases/download/${{ needs.release.outputs.tag }}/${{ needs.release.outputs.artifact-name }} | |
sha256: ${{ env.FILE_SHA256 }} |