|
| 1 | +name: Update BPMN Visualization version |
| 2 | +on: |
| 3 | + repository_dispatch: |
| 4 | + types: [update_bpmn_visualization_version] |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + version: |
| 8 | + description: 'Version' |
| 9 | + required: true |
| 10 | + build_demo_repo: |
| 11 | + description: 'The repository where the demo artifact is stored' |
| 12 | + default: "process-analytics/download-workflow-artifact" |
| 13 | + build_demo_workflow_id: |
| 14 | + description: 'The workflow identifier where the demo artifact is stored' |
| 15 | + default: "build_demo" |
| 16 | + demo_sha: |
| 17 | + description: 'SHA from the demo artifact name' |
| 18 | + required: true |
| 19 | + |
| 20 | +jobs: |
| 21 | + updateVersion: |
| 22 | + runs-on: ubuntu-20.04 |
| 23 | + env: |
| 24 | + VERSION: ${{ github.event.client_payload.version || github.event.inputs.version }} |
| 25 | + DEMO_SHA: ${{ github.event.client_payload.demo_sha || github.event.inputs.demo_sha }} |
| 26 | + BUILD_DEMO_WORKFLOW_ID: ${{ github.event.client_payload.build_demo_workflow_id || github.event.inputs.build_demo_workflow_id }} |
| 27 | + BUILD_DEMO_REPO: ${{ github.event.client_payload.build_demo_repo || github.event.inputs.build_demo_repo }} |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v2 |
| 30 | + - name: Update examples |
| 31 | + run: echo "Examples updated with version ${{ env.VERSION }}" |
| 32 | + - name: Download Demo ${{ env.VERSION }} |
| 33 | + uses: dawidd6/action-download-artifact@v2 |
| 34 | + with: |
| 35 | + github_token: ${{ secrets.ACCESS_TOKEN }} |
| 36 | + repo: ${{ env.BUILD_DEMO_REPO }} |
| 37 | + workflow: ${{ env.BUILD_DEMO_WORKFLOW_ID }} |
| 38 | + workflow_conclusion: success |
| 39 | + name: demo-${{ env.DEMO_SHA }} |
| 40 | + path: path/to/artifact |
| 41 | + - name: Display structure of downloaded files |
| 42 | + run: ls -R |
| 43 | + working-directory: path/to/artifact |
| 44 | + - name: Create Pull Request |
| 45 | + uses: peter-evans/create-pull-request@v3 |
| 46 | + with: |
| 47 | + commit-message: "Commit & Push changes" |
| 48 | + committer: "GitHub <[email protected]>" |
| 49 | + author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" |
| 50 | + branch: "infra/update_bpmn_visualization_to_${{ env.VERSION }}" |
| 51 | + delete-branch: true |
| 52 | + base: "master" |
| 53 | + title: "[INFRA] Update BPMN Visualization version to ${{ env.VERSION }}" |
| 54 | + body: "https://cdn.statically.io/gh/process-analytics/bpmn-visualization-examples/infra/update_bpmn_visualization_to_${{ env.VERSION }}/examples/index.html" |
| 55 | + labels: "enhancement" |
| 56 | + reviewers: "csouchet" |
| 57 | + draft: true |
0 commit comments