|
| 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/bpmn-visualization-js" |
| 13 | + build_demo_workflow_id: |
| 14 | + description: 'The workflow identifier or file name where the demo artifact is stored' |
| 15 | + default: "upload-demo-archive-and-trigger-examples-repository-update.yml" |
| 16 | + |
| 17 | + // To change. no bpmn-visualization.min.js in demo atifact |
| 18 | + artifact_name: |
| 19 | + description: 'The demo artifact name' |
| 20 | + default: "demo_" |
| 21 | + required: true |
| 22 | + |
| 23 | +jobs: |
| 24 | + updateVersion: |
| 25 | + runs-on: ubuntu-20.04 |
| 26 | + env: |
| 27 | + VERSION: ${{ github.event.client_payload.version || github.event.inputs.version }} |
| 28 | + ARTIFACT_NAME: ${{ github.event.client_payload.artifact_name || github.event.inputs.artifact_name }} |
| 29 | + BUILD_DEMO_WORKFLOW_ID: ${{ github.event.client_payload.build_demo_workflow_id || github.event.inputs.build_demo_workflow_id }} |
| 30 | + BUILD_DEMO_REPO: ${{ github.event.client_payload.build_demo_repo || github.event.inputs.build_demo_repo }} |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v2 |
| 33 | + - name: Delete old BPMN Visualization version |
| 34 | + run: rm -rf inst/htmlwidgets/lib/bpmn-visualization |
| 35 | + |
| 36 | + // To change. no bpmn-visualization.min.js in demo atifact |
| 37 | + - name: Download BPMN Visualization ${{ env.VERSION }} |
| 38 | + uses: dawidd6/action-download-artifact@v2 |
| 39 | + with: |
| 40 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 41 | + repo: ${{ env.BUILD_DEMO_REPO }} |
| 42 | + workflow: ${{ env.BUILD_DEMO_WORKFLOW_ID }} |
| 43 | + workflow_conclusion: success |
| 44 | + name: ${{ env.ARTIFACT_NAME }} |
| 45 | + path: inst/htmlwidgets/lib/bpmn-visualization |
| 46 | + |
| 47 | + |
| 48 | + - name: Update BPMN Visualization version in YAML file |
| 49 | + run: sed -i -E "s/version: \".*\"/version: \"${{ env.VERSION }}\"/" inst/htmlwidgets/bpmnVisualization.yaml |
| 50 | + - name: Create Pull Request |
| 51 | + uses: peter-evans/create-pull-request@v3 |
| 52 | + with: |
| 53 | + token: ${{ secrets.GH_RELEASE_TOKEN }} |
| 54 | + commit-message: "[INFRA] Update BPMN Visualization version to ${{ env.VERSION }}" |
| 55 | + committer: "process-analytics-bot <62586190+process-analytics-bot@users.noreply.github.com>" |
| 56 | + author: "process-analytics-bot <62586190+process-analytics-bot@users.noreply.github.com>" |
| 57 | + branch: "infra/update_bpmn_visualization_to_${{ env.VERSION }}" |
| 58 | + delete-branch: true |
| 59 | + base: "master" |
| 60 | + title: "[INFRA] Update BPMN Visualization version to ${{ env.VERSION }}" |
| 61 | + body: "" |
| 62 | + labels: "enhancement" |
| 63 | + team-reviewers: js-lib-collaborators |
| 64 | + draft: true |
0 commit comments