@@ -40,21 +40,19 @@ jobs:
40
40
determine-languages :
41
41
runs-on : ubuntu-latest
42
42
outputs :
43
- matrix : ${{ steps.set-matrix .outputs.matrix }}
43
+ languages : ${{ steps.set-languages .outputs.languages }}
44
44
steps :
45
- - id : set-matrix
45
+ - id : set-languages
46
46
run : |
47
47
if [ "${{ inputs.language }}" == "all" ]; then
48
- echo 'matrix={"language":[" java","rb","py"," dotnet"," node"]}' >> $GITHUB_OUTPUT
48
+ echo '"languages= java rb py dotnet node" >> $GITHUB_OUTPUT
49
49
else
50
- echo 'matrix={"language":[" ${{ inputs.language }}"]}' >> $GITHUB_OUTPUT
50
+ echo "languages= ${{ inputs.language }}" >> $GITHUB_OUTPUT
51
51
fi
52
+
52
53
build-docs :
53
54
needs : determine-languages
54
55
runs-on : ubuntu-latest
55
- strategy :
56
- matrix : ${{ fromJson(needs.determine-languages.outputs.matrix) }}
57
- fail-fast : false
58
56
steps :
59
57
- name : Checkout repository
60
58
uses : actions/checkout@v4
@@ -69,43 +67,55 @@ jobs:
69
67
- name : Setup curl for Ubuntu
70
68
run : sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
71
69
- name : Setup Java
70
+ if : contains(needs.determine-languages.outputs.languages, 'java')
72
71
uses : actions/setup-java@v4
73
72
with :
74
73
java-version : 17
75
74
distribution : ' temurin'
76
75
- name : Set up Python 3.9
77
- if : ${{ matrix.language == 'py' }}
76
+ if : contains(needs.determine-languages.outputs.languages, 'py')
78
77
uses : actions/setup-python@v5
79
78
with :
80
79
python-version : 3.9
81
80
- name : Install dependencies
82
- if : ${{ matrix.language == 'py' }}
81
+ if : contains(needs.determine-languages.outputs.languages, 'py')
83
82
run : |
84
83
python -m pip install --upgrade pip
85
84
pip install tox
86
85
- name : Install npm dependencies
87
- if : ${{ matrix.language == 'node' }}
86
+ if : contains(needs.determine-languages.outputs.languages, 'node')
88
87
run : |
89
88
npm install
90
89
npm install --prefix javascript/selenium-webdriver
91
- - name : Update Documentation
92
- run : ./go ${{ matrix.language }}:docs
90
+ - name : Generate Documentation for selected langauges
91
+ run : |
92
+ read -r -a LANGS <<< "${{ needs.determine-languages.outputs.languages }}"
93
+ for lang in "${LANGS[@]}"; do
94
+ echo "Generating docs for $lang"
95
+ ./go $lang:docs
96
+ done
93
97
- name : Documentation Pull Request
98
+ id : cpr
94
99
uses : peter-evans/create-pull-request@v6
95
100
with :
96
101
token : ${{ secrets.SELENIUM_CI_TOKEN }}
97
102
author :
Selenium CI Bot <[email protected] >
98
103
delete-branch : true
99
- branch : api-docs-${{ inputs.version }}-${{ matrix.language }}
104
+ branch : api-docs-${{ inputs.version }}
100
105
base : gh-pages
101
- add-paths : |
102
- ${{ matrix.language == 'node' && 'docs/api/javascript/**' || format('docs/api/{0}/**', matrix.language) }}
103
- title : Update documentation for Selenium ${{ inputs.version }} (${{ matrix.language }})
106
+ add-paths : docs/api/**
107
+ title : Update documentation for Selenium ${{ inputs.version }}
104
108
body : |
105
- This PR updates the API documentation for **${{ matrix.language }}** language bindings to version **${{ inputs.version }}**.
106
-
107
- - Auto-generated by [create-pull-request][1]
109
+ This PR updates the API documentation for version **${{ inputs.version }}**.
110
+ Languages updated: ${{ needs.determine-languages.outputs.languages }}
108
111
109
- [1]: https://github.com/peter-evans/create-pull-request
112
+ - Auto-generated by [workflow run #${{ github.run_id }}]( https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
110
113
labels : B-docs
111
114
draft : false
115
+ - name : Enable Pull Request Auto-merge
116
+ if : steps.cpr.outputs.pull-request-operation == 'created'
117
+ uses : peter-evans/enable-pull-request-automerge@v3
118
+ with :
119
+ token : ${{ secrets.SELENIUM_CI_TOKEN }}
120
+ pull-request-number : ${{ steps.cpr.outputs.pull-request-number }}
121
+ merge-method : squash
0 commit comments