sync-from-ui-release #25
This file contains hidden or 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: On Release Dispatch | |
| on: | |
| repository_dispatch: | |
| types: [sync-from-ui-release] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| actions: write | |
| jobs: | |
| sync-ui: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| commit_hash: ${{ steps.commit_changes.outputs.commit_hash }} | |
| release_url: ${{ steps.create_release.outputs.url }} | |
| steps: | |
| - name: Generate token | |
| id: generate_token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.TEMPORAL_CICD_APP_ID }} | |
| private-key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }} | |
| - name: Checkout ui-server | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.generate_token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| run: | | |
| echo ${{ steps.generate_token.outputs.token }} | gh auth login --with-token | |
| gh auth status -a | |
| git config --global user.name "temporal-cicd[bot]" | |
| git config --global user.email "gh-action@users.noreply.github.com" | |
| - name: Download and Build UI | |
| uses: ./.github/actions/download-and-build-ui | |
| with: | |
| ref: ${{ github.event.client_payload.ref }} | |
| upstream_org: ${{ vars.UPSTREAM_ORG }} | |
| upstream_repo: ${{ vars.UPSTREAM_REPO }} | |
| - name: Commit changes | |
| id: commit_changes | |
| uses: ./.github/actions/commit-changes | |
| with: | |
| message: "Sync from UI release ${{ github.event.client_payload.release_tag }}" | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| target_commitish: ${{ steps.commit_changes.outputs.commit_hash }} | |
| generate_release_notes: true | |
| tag_name: ${{ github.event.client_payload.release_tag }} | |
| name: ${{ github.event.client_payload.release_tag }} | |
| body: | | |
| Release synced from [ui@${{ github.event.client_payload.release_tag }}](${{ github.event.client_payload.release_url }}) | |
| release-and-dispatch: | |
| uses: ./.github/workflows/on-release.yaml | |
| needs: [sync-ui] | |
| secrets: inherit | |
| with: | |
| ref: ${{ needs.sync-ui.outputs.commit_hash }} | |
| release_tag: ${{ github.event.client_payload.release_tag }} | |
| release_url: ${{ needs.sync-ui.outputs.release_url }} |