-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
48 lines (39 loc) · 1.54 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
name: 'WIPAC Dev Py Versions'
description: 'GitHub Action Package for Generating a Build Matrix of Supported Python Versions for a Package'
inputs:
range:
description: 'Optional semantic versioning expression for supported Python releases (e.g., ">=3.9", ">=3.8, <3.13"), if not given then the range will be retrived from python package metadata.'
required: false
default: ''
outputs:
matrix:
description: "List of Supported Python Versions"
value: ${{ steps.gather-py-versions.outputs.matrix }}
runs:
using: "composite"
steps:
- id: gather-py-versions
run: |
set -e
sudo apt-get update
python -m venv action_venv
. action_venv/bin/activate
pip3 install -r ${{ github.action_path }}/requirements.txt
SEMVER_RANGE="${{ inputs.range }}"
if [ -z "$SEMVER_RANGE" ]; then
SEMVER_RANGE=$(python ${{ github.action_path }}/parse_out_range.py)
fi
MIN_THRU_MAX_SERIES_SPACED=$(python -c "
from wipac_dev_tools import semver_parser_tools
top_python = semver_parser_tools.get_latest_py3_release()
all_matches = semver_parser_tools.list_all_majmin_versions(
major=top_python[0],
semver_range='$SEMVER_RANGE',
max_minor=top_python[1],
)
print(' '.join(f'{v[0]}.{v[1]}' for v in all_matches))
")
echo $MIN_THRU_MAX_SERIES_SPACED
# now, output
echo "matrix=$( echo $MIN_THRU_MAX_SERIES_SPACED | jq -cR 'split(" ")' )" >> $GITHUB_OUTPUT
shell: bash