-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] add workflow to create a branch with documentation updates
- Loading branch information
1 parent
566bac6
commit 995735d
Showing
2 changed files
with
142 additions
and
85 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,29 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.tag }} | ||
- name: Prep git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Selenium CI Bot" | ||
- name: Get updated Rakefile | ||
run: | | ||
git fetch origin auto_docs | ||
git checkout origin/auto_docs -- Rakefile | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
- name: Update Documentation | ||
run: ./go java:docs[true] | ||
run: ./go java:docs | ||
- name: Create patch for changes | ||
run: | | ||
git format-patch -1 HEAD --stdout > java-docs.patch | ||
- name: Upload patch | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: java-docs-patch | ||
path: java-docs.patch | ||
|
||
ruby-docs: | ||
runs-on: ubuntu-latest | ||
|
@@ -34,13 +50,29 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.tag }} | ||
- name: Prep git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Selenium CI Bot" | ||
- name: Get updated Rakefile | ||
run: | | ||
git fetch origin auto_docs | ||
git checkout origin/auto_docs -- Rakefile | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
- name: Update Documentation | ||
run: ./go ruby:docs[true] | ||
run: ./go rb:docs | ||
- name: Create patch for changes | ||
run: | | ||
git format-patch -1 HEAD --stdout > ruby-docs.patch | ||
- name: Upload patch | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ruby-docs-patch | ||
path: ruby-docs.patch | ||
|
||
python-docs: | ||
runs-on: ubuntu-latest | ||
|
@@ -49,12 +81,32 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.tag }} | ||
- name: Prep git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Selenium CI Bot" | ||
- name: Get updated Rakefile | ||
run: | | ||
git fetch origin auto_docs | ||
git checkout origin/auto_docs -- Rakefile | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox | ||
- name: Update Documentation | ||
run: ./go py:docs[true] | ||
run: ./go py:docs | ||
- name: Create patch for changes | ||
run: | | ||
git format-patch -1 HEAD --stdout > python-docs.patch | ||
- name: Upload patch | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: python-docs-patch | ||
path: python-docs.patch | ||
|
||
dotnet-docs: | ||
runs-on: ubuntu-latest | ||
|
@@ -63,12 +115,28 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.tag }} | ||
- name: Prep git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Selenium CI Bot" | ||
- name: Get updated Rakefile | ||
run: | | ||
git fetch origin auto_docs | ||
git checkout origin/auto_docs -- Rakefile | ||
- name: Install specific version of DocFX tool | ||
# Pinning to 2.75.3 to avoid breaking changes in newer versions | ||
# See https://github.com/dotnet/docfx/issues/9855 | ||
run: dotnet tool install --global --version 2.75.3 docfx | ||
- name: Update Documentation | ||
run: ./go dotnet:docs[true] | ||
run: ./go dotnet:docs | ||
- name: Create patch for changes | ||
run: | | ||
git format-patch -1 HEAD --stdout > dotnet-docs.patch | ||
- name: Upload patch | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dotnet-docs-patch | ||
path: dotnet-docs.patch | ||
|
||
node-docs: | ||
runs-on: ubuntu-latest | ||
|
@@ -77,9 +145,67 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.tag }} | ||
- name: Prep git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Selenium CI Bot" | ||
- name: Get updated Rakefile | ||
run: | | ||
git fetch origin auto_docs | ||
git checkout origin/auto_docs -- Rakefile | ||
- name: Install npm dependencies | ||
run: | | ||
npm install | ||
npm install --prefix javascript/node/selenium-webdriver | ||
- name: Update Documentation | ||
run: ./go node:docs[true] | ||
run: ./go node:docs | ||
- name: Create patch for changes | ||
run: | | ||
git format-patch -1 HEAD --stdout > node-docs.patch | ||
- name: Upload patch | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: node-docs-patch | ||
path: node-docs.patch | ||
|
||
merge-patches: | ||
runs-on: ubuntu-latest | ||
needs: [java-docs, ruby-docs, python-docs, dotnet-docs, node-docs] | ||
steps: | ||
- name: Checkout documentation branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: 'gh-pages' | ||
- name: Create and checkout new branch | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Selenium CI Bot" | ||
git checkout -b api-docs-${{ inputs.tag }} | ||
- name: Download patches | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: java-docs-patch | ||
path: patches/ | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: ruby-docs-patch | ||
path: patches/ | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: python-docs-patch | ||
path: patches/ | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: dotnet-docs-patch | ||
path: patches/ | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: node-docs-patch | ||
path: patches/ | ||
- name: Apply patches | ||
run: | | ||
for patch in patches/*.patch; do | ||
git am < "$patch" | ||
done | ||
- name: Push Branch | ||
run: git push origin api-docs-${{ inputs.tag }} |
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