-
Notifications
You must be signed in to change notification settings - Fork 25
52 lines (40 loc) · 2.06 KB
/
re-generate.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
name: Re Generate Docs
on:
workflow_dispatch:
push:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout vmware/build-tools-for-vmware-aria repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install xmllint
run: sudo apt-get install libxml2-utils
- name: Install necessary plugins
run: |
mvn clean install -f maven/plugins/pom.xml
- name: Generate plugin arguments
run: |
for POM_PATH in $(find maven/plugins -mindepth 2 -maxdepth 2 -name pom.xml -type f -not -path "maven/plugins/common/*"); do # Not recommended, will break on whitespace
echo "Processing $POM_PATH..."
GROUP_ID=$(xmllint --xpath '/*[local-name()="project"]/*[local-name()="parent"]/*[local-name()="groupId"]/text()' $POM_PATH)
echo "Group ID: $GROUP_ID"
ARTIFACT_ID=$(xmllint --xpath '/*[local-name()="project"]/*[local-name()="artifactId"]/text()' $POM_PATH)
echo "Artifact ID: $ARTIFACT_ID"
PLUGIN_VERSION=$(xmllint --xpath '/*[local-name()="project"]/*[local-name()="parent"]/*[local-name()="version"]/text()' $POM_PATH)
echo "Version: $PLUGIN_VERSION"
PLUGIN_FOLDER=$(dirname $POM_PATH)
PLUGIN_FOLDER="${PLUGIN_FOLDER##*/}"
echo "Plugin Folder: $PLUGIN_FOLDER"
# mvn help:describe -D"groupId=$GROUP_ID" -D"artifactId=$ARTIFACT_ID" -D"version=$PLUGIN_VERSION" -Ddetail --batch-mode -f $POM_PATH | awk '!/INFO/ && !/WARNING/{ print $0 }' | tail -n +2 > docs/versions/latest/General/Cheatsheets/$PLUGIN_FOLDER-plugin-arguments.md
mvn help:describe -D"groupId=$GROUP_ID" -D"artifactId=$ARTIFACT_ID" -D"version=$PLUGIN_VERSION" -Ddetail --batch-mode -f $POM_PATH
done
- name: Print current branch
run: echo "Current branch is $GITHUB_REF"
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}