-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
124 lines (102 loc) · 3.91 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
name: 'Python Versionator'
description: 'Autoupdate the python package versions in your Github action matrix.'
inputs:
action_path:
description: 'The path to the action file to update.'
required: true
package:
description: 'The python package whose version is being tracked.'
required: true
readme_path:
description: 'The path to the README file to update.'
required: true
default: "${{ github.workspace }}/README.md"
template_directory:
description: 'The path to the README template.'
required: true
default: ""
repository:
description: 'The repository, for updating the readme.'
required: true
default: ${{ github.repository }}
organization:
description: 'The organization, for updating the readme.'
required: true
default: ${{ github.repository_owner }}
git_name:
description: 'The name to use as the author of the commit.'
required: true
default: ${{ github.repository_owner }}
git_email:
description: 'The email to use for the author of the commit.'
required: true
default: "[email protected]"
max_versions:
description: 'The maximum number of versions (from most current back) to inject into the action.'
required: true
default: '5'
exclude_versions:
description: 'A comma separated list of versions to exclude.'
required: true
default: ''
skip_readme:
description: 'When set to true the readme fill will not be generated.'
required: true
default: 'false'
include_prereleases:
description: 'If set to true prereleases (alpha, beta, rc) will also be built.'
required: true
default: "false"
update_python:
description: 'When enabled python versions will also be updated.'
required: true
default: 'true'
runs:
using: "composite"
steps:
- uses: "actions/setup-python@v5"
- name: Update Package Versions
shell: bash
run: "bash ${{ github.action_path }}/scripts/update_packages.sh \"${{ inputs.package }}\" \"${{ inputs.action_path }}\""
env:
MAX_VERSIONS: ${{ inputs.max_versions }}
INCLUDE_PRERELEASE: ${{ inputs.include_prereleases }}
EXCLUDE_VERSIONS: ${{ inputs.exclude_versions }}
- name: Update Python Versions
shell: bash
run: |
if [ "${{inputs.update_python}}" == "true" ]; \
then sed -i 's/python_versions:.*/python_versions: [\"3.9\", \"3.10\", \"3.11\", \"3.12\", \"3.13\"] /' "${{ inputs.action_path }}"; \
else echo "Skipping python version update"; fi
- name: "Install Jinja2"
shell: bash
run: "python -m pip install jinja2 pyyaml"
- name: "Install github-markdown-toc"
shell: bash
run: |
curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o ${{ github.action_path }}/scripts/gh-md-toc
chmod a+x ${{ github.action_path }}/scripts/gh-md-toc
- name: "Update README.md"
shell: bash
run: "bash ${{ github.action_path }}/scripts/update_readme.sh \"${{ inputs.readme_path }}\""
env:
TEMPLATE_DIRECTORY: ${{ inputs.template_directory }}
PACKAGE: ${{ inputs.package }}
PROJECT_NAME: ${{ inputs.package }}
PYTHON_VERSIONS: "3.8 3.9 3.10 3.11 3.12"
MAX_VERSIONS: ${{ inputs.max_versions }}
ORGANIZATION: ${{ inputs.organization }}
REPOSITORY: ${{ inputs.repository }}
REPOSITORY_SHORT: ${{ github.event.repository.name }}
INCLUDE_PRERELEASE: ${{ inputs.include_prereleases }}
BUILDER_WORKFLOW_PATH: ${{ inputs.action_path }}
EXCLUDE_VERSIONS: ${{ inputs.exclude_versions }}
SKIP_README: ${{ inputs.skip_readme }}
- name: "Push"
shell: bash
run: "bash ${{ github.action_path }}/scripts/push.sh"
env:
GIT_USER: ${{ inputs.git_name }}
GIT_EMAIL: ${{ inputs.git_email }}
ACTION_PATH: ${{ inputs.action_path }}
README_PATH: ${{ inputs.readme_path }}