-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (52 loc) · 2.68 KB
/
post-release-update_bpmn_visualization_version_in_R_repo.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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