update_bpmn_visualization_version #86
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
name: Update the version of the bpmn-visualization TypeScript library | |
on: | |
repository_dispatch: | |
types: [ update_bpmn_visualization_version ] | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version' | |
required: true | |
build_demo_repo: | |
description: 'The repository where the demo artifact is stored' | |
default: "process-analytics/bpmn-visualization-js" | |
required: true | |
build_demo_workflow_id: | |
description: 'The workflow identifier or file name where the demo artifact is stored' | |
default: "upload-demo-archive-and-trigger-examples-repository-update.yml" | |
required: true | |
artifact_name: | |
description: 'The demo artifact name' | |
default: "demo_" | |
required: true | |
jobs: | |
compute-iife-bundle-integrity: | |
runs-on: ubuntu-22.04 | |
env: | |
VERSION: ${{ github.event.client_payload.version || github.event.inputs.version }} | |
outputs: | |
integrity-value: ${{ steps.compute-integrity.outputs.value }} | |
steps: | |
- name: Get the bpmn-visualization npm package | |
run: | | |
curl https://registry.npmjs.org/bpmn-visualization/-/bpmn-visualization-${{ env.VERSION }}.tgz -o bpmn-visualization.tgz | |
PACKAGE_CHECKSUM=$(npm view bpmn-visualization@${{ env.VERSION }} dist.integrity) | |
echo "PACKAGE_CHECKSUM=$PACKAGE_CHECKSUM" | |
tar -xvzf bpmn-visualization.tgz | |
- name: Compute IIFE bundle integrity | |
id: 'compute-integrity' | |
run: | | |
integrity="sha384-$(cat ./package/dist/bpmn-visualization.min.js | openssl dgst -sha384 -binary | openssl base64 -A)" | |
echo "integrity=$integrity" | |
echo "value=$integrity" >> "$GITHUB_OUTPUT" | |
update-version: | |
runs-on: ubuntu-22.04 | |
needs: compute-iife-bundle-integrity | |
env: | |
VERSION: ${{ github.event.client_payload.version || github.event.inputs.version }} | |
ARTIFACT_NAME: ${{ github.event.client_payload.artifact_name || github.event.inputs.artifact_name }} | |
BUILD_DEMO_WORKFLOW_ID: ${{ github.event.client_payload.build_demo_workflow_id || github.event.inputs.build_demo_workflow_id }} | |
BUILD_DEMO_REPO: ${{ github.event.client_payload.build_demo_repo || github.event.inputs.build_demo_repo }} | |
IIFE_BUNDLE_INTEGRITY: ${{needs.compute-iife-bundle-integrity.outputs.integrity-value}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update bpmn-visualization version in all examples | |
run: ./scripts/update-lib-version.bash ${{ env.VERSION }} ${{ env.IIFE_BUNDLE_INTEGRITY }} | |
- name: Delete old Load and Navigation demo | |
run: rm -rf demo/load-and-navigation | |
- name: Download Load and Navigation demo ${{ env.VERSION }} | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
github_token: ${{ secrets.GH_RELEASE_TOKEN }} | |
repo: ${{ env.BUILD_DEMO_REPO }} | |
workflow: ${{ env.BUILD_DEMO_WORKFLOW_ID }} | |
workflow_conclusion: success | |
name: ${{ env.ARTIFACT_NAME }} | |
path: demo/load-and-navigation | |
- name: Create Pull Request | |
uses: peter-evans/[email protected] | |
with: | |
token: ${{ secrets.GH_RELEASE_TOKEN }} | |
commit-message: "chore(deps): bump bpmn-visualization to ${{ env.VERSION }}" | |
committer: "process-analytics-bot <[email protected]>" | |
author: "process-analytics-bot <[email protected]>" | |
branch: "chore/update_bpmn_visualization_to_${{ env.VERSION }}" | |
delete-branch: true | |
base: "master" | |
title: "chore(deps): bump bpmn-visualization to ${{ env.VERSION }}" | |
body: "https://cdn.statically.io/gh/process-analytics/bpmn-visualization-examples/chore/update_bpmn_visualization_to_${{ env.VERSION }}/examples/index.html" | |
labels: "enhancement" | |
team-reviewers: pa-collaborators | |
draft: true |