generated from actions/hello-world-javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
150 lines (131 loc) · 5.06 KB
/
action.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: 'Update wiki with PHP project documentation'
description: 'Updates project wiki with automatic generated PHP project documentation'
branding:
icon: book
color: purple
inputs:
wiki_github_update_token:
description: GitHub token to use for updating project wiki
required: false
default: ${{ github.token }}
wiki_github_update_user:
description: GitHub username for whom this token belongs
required: false
default: ${{ github.actor }}
engine:
description: What documentation generator should be used
required: false
default: clean/phpdoc-md
class_root_namespace:
description: Root class namespace that should be used for documentation
required: false
include:
description: Defines what classes should be included in generated documentation (supports glob style wildcards syntax; each line means one rule)
required: false
default: ''
ignored_files:
description: Defines files that can be ignored (supports glob rules)
required: false
default: ''
prefix_lines:
description: Lines that will be used to prefix generated wiki content
required: false
default: |
##### Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!
setup_php:
description: Automatically setups PHP for action (default)
required: false
default: 'true'
branches_map:
description: "This is used to map repo branches with wiki branches (format: local repo branch: wiki repo branch)"
required: false
default: |
main: master
runs:
using: 'composite'
steps:
- name: Setuping...
run: bash "$GITHUB_ACTION_PATH/bin/setup.sh" "${{ inputs.engine }}"
shell: bash
- name: Setup yq environment
run: |
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
chmod a+x /usr/local/bin/yq
yq --version
shell: bash
- name: Installing PHP...
uses: shivammathur/[email protected]
with:
php-version: ${{ env.NEEDED_PHP_VERSION }}
extensions: curl, gd, pdo_mysql, json, mbstring, pcre, session
ini-values: post_max_size=256M
coverage: none
tools: composer:v2
if: inputs.setup_php == 'true'
- name: Writing tmp branches map file...
uses: DamianReeves/write-file-action@master
with:
path: ${{ env.TMP_BRANCH_MAP_FILE }}
contents: ${{ inputs.branches_map }}
write-mode: overwrite
- name: Running composer...
run: composer install --no-scripts --no-plugins -n -o
shell: bash
if: inputs.setup_php == 'true'
- name: Cloning original wiki...
run: |
bash ${{ github.action_path }}/bin/cloning.sh \
"${{ inputs.wiki_github_update_token }}" \
"${{ inputs.wiki_github_update_user }}"
shell: bash
- name: Configuring GIT...
run: |
bash ${{ github.action_path }}/bin/configure_git.sh \
"${{ inputs.wiki_github_update_user }}" \
"${{ inputs.wiki_github_update_user }}@users.noreply.github.com"
shell: bash
- name: Checkouting needed branch...
run: bash ${{ github.action_path }}/bin/checkout.sh
shell: bash
- name: Generating new documentation with clean/phpdoc-md...
uses: impresscms-dev/[email protected]
with:
class_root_namespace: ${{ inputs.class_root_namespace }}
included_classes: ${{ inputs.include }}
output_path: ${{ env.NEW_WIKI_CHECKOUT_PATH }}
if: inputs.engine == 'clean/phpdoc-md'
- name: Generating new documentation with evert/phpdoc-md...
uses: impresscms-dev/[email protected]
with:
ignored_files: ${{ inputs.ignored_files }}
output_path: ${{ env.NEW_WIKI_CHECKOUT_PATH }}
if: inputs.engine == 'evert/phpdoc-md'
- name: Renaming index file...
run: bash ${{ github.action_path }}/bin/rename_index.sh "${{ inputs.engine }}"
shell: bash
- name: Prefixing files...
uses: impresscms-dev/[email protected]
with:
path: ${{ env.NEW_WIKI_CHECKOUT_PATH }}
text: ${{ inputs.prefix_lines }}
suffix: false
if: inputs.prefix_lines != ''
- name: Flattering new documentation...
uses: impresscms-dev/[email protected]
with:
path: ${{ env.NEW_WIKI_CHECKOUT_PATH }}
- name: Stripping MarkDown file extensions...
uses: impresscms-dev/[email protected]
with:
path: ${{ env.NEW_WIKI_CHECKOUT_PATH }}
- name: Moving old .git data to new docs folder...
run: mv "$OLD_WIKI_CHECKOUT_PATH"/.git "$NEW_WIKI_CHECKOUT_PATH/"
shell: bash
- name: Commit and push wiki changes...
run: |
bash ${{ github.action_path }}/bin/commit_and_push.sh \
"${{ github.event.commits[0].message }}"
shell: bash
- name: Clearing temp paths...
run: bash ${{ github.action_path }}/bin/clear_tmp_data.sh
shell: bash