Skip to content

Update the version of the bpmn-visualization TypeScript library in R repo #69

Update the version of the bpmn-visualization TypeScript library in R repo

Update the version of the bpmn-visualization TypeScript library in R repo #69

name: Update the version of the bpmn-visualization TypeScript library in R repo
on:
repository_dispatch:
types: [ update_bpmn_visualization_version ]
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
jobs:
updateVersion:
runs-on: ${{ vars.RUNNER_UBUNTU }}
env:
VERSION: ${{ github.event.client_payload.version || inputs.version }}
steps:
- uses: actions/checkout@v4
- name: Get the old version of bpmn-visualization
id: lookupOldBPMNVisuVersion
uses: mikefarah/yq@v4
with:
cmd: yq '.dependencies[] | select(.name == "bpmn-visualization") | .version' inst/htmlwidgets/bpmnVisualizationR.yaml
- run: echo "OLD_VERSION=${{ steps.lookupOldBPMNVisuVersion.outputs.result }}" >> $GITHUB_ENV
- name: Delete the old bpmn-visualization
run: rm inst/htmlwidgets/lib/bpmn-visualization/bpmn-visualization.min.js
- name: Download bpmn-visualization@${{ env.VERSION }}
uses: carlosperate/download-file-action@v2
with:
# Use a hard coded version as the release version in this repository doesn't follow bpmn-visualization release versions
# This ensures we can download the js file
file-url: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/bpmn-visualization.min.js'
location: 'inst/htmlwidgets/lib/bpmn-visualization'
- name: Update the bpmn-visualization version in the YAML file
run: |
sed -i -E 's/version: ".*"/version: "${{ env.VERSION }}"/' inst/htmlwidgets/bpmnVisualizationR.yaml
- name: Display structure of downloaded files
run: ls -R
working-directory: inst/htmlwidgets
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GH_RELEASE_TOKEN }}
commit-message: "chore(deps): bump bpmn-visualization from ${{ env.OLD_VERSION }} to ${{ env.VERSION }}"
committer: "${{ vars.PA_BOT_NAME }} <${{ vars.PA_BOT_EMAIL }}>"
author: "${{ vars.PA_BOT_NAME }} <${{ vars.PA_BOT_EMAIL }}>"
branch: "chore/bump_bpmn_visualization_from_${{ env.OLD_VERSION }}_to_${{ env.VERSION }}"
delete-branch: true
base: "master"
title: "chore(deps): bump bpmn-visualization from ${{ env.OLD_VERSION }} to ${{ env.VERSION }}"
body: "Perform what we have to do to update bpmn-visualization-js in the bpmn-visualization-R package. bpmn-visualization is updated from https://cdn.jsdelivr.net/npm/bpmn-visualization@${{ env.VERSION }}/dist/bpmn-visualization.min.js."
labels: "dependencies"
team-reviewers: pa-collaborators
draft: true