-
Notifications
You must be signed in to change notification settings - Fork 32
157 lines (132 loc) · 4.48 KB
/
listgen.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
151
152
153
154
155
156
157
name: Generate stdlib lists
on:
workflow_dispatch:
inputs:
dry-run:
description: "Don't create any PRs for this run"
type: boolean
default: false
schedule:
- cron: "0 0 * * 2"
jobs:
pre-list-legacy:
strategy:
matrix:
python:
- "3.7"
- "3.8"
- "3.9"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
# NOTE: matrix.python is intentionally not used here.
python-version: "3.x"
- name: support deps
run: make dev INSTALL_EXTRA=support
- name: build pre-list
env:
LISTGEN_PYTHON_VERSION: "${{ matrix.python }}"
run: |
./env/bin/python ./support/fetch-sphinx.py "${LISTGEN_PYTHON_VERSION}" > pre-list.txt
- name: upload pre-list
uses: actions/upload-artifact@v4
with:
name: pre-list-${{ matrix.python }}
path: pre-list.txt
expand-list-legacy:
needs: pre-list-legacy
strategy:
matrix:
python:
- "3.7"
- "3.8"
- "3.9"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@v4
with:
name: pre-list-${{ matrix.python }}
- name: walk modules
env:
LISTGEN_PYTHON_VERSION: ${{ matrix.python }}
LISTGEN_DRY_RUN: ${{ inputs.dry-run }}
run: |
python ./support/walk-modules.py "${LISTGEN_PYTHON_VERSION}.txt" < pre-list.txt
rm pre-list.txt
if [[ -f "./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt"" ]]; then
sort -u -o ./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt" \
./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt" \
"${LISTGEN_PYTHON_VERSION}.txt"
else
sort -u -o ./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt" \
"${LISTGEN_PYTHON_VERSION}.txt"
fi
rm "${LISTGEN_PYTHON_VERSION}.txt"
if [[ "${LISTGEN_DRY_RUN}" == "true" ]]; then
git diff
fi
- name: create PR
if: ${{ !inputs.dry-run }}
uses: peter-evans/create-pull-request@v5
with:
commit-message: "[BOT] update list for ${{ matrix.python }}"
branch: update-stdlib-list-${{ matrix.python }}
base: main
branch-suffix: timestamp
title: "[BOT] update list for ${{ matrix.python }}"
body: |
This is an automated pull request, updating `${{ matrix.python }}.txt` after a detected change.
Please review manually before merging.
assignees: "woodruffw"
reviewers: "woodruffw"
expand-list:
strategy:
matrix:
python:
- "3.10"
- "3.11"
- "3.12"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: walk modules
env:
LISTGEN_PYTHON_VERSION: ${{ matrix.python }}
LISTGEN_DRY_RUN: ${{ inputs.dry-run }}
run: |
python ./support/walk-modules.py "${LISTGEN_PYTHON_VERSION}.txt"
if [[ -f "./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt"" ]]; then
sort -u -o ./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt" \
./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt" \
"${LISTGEN_PYTHON_VERSION}.txt"
else
sort -u -o ./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt" \
"${LISTGEN_PYTHON_VERSION}.txt"
fi
rm "${LISTGEN_PYTHON_VERSION}.txt"
if [[ "${LISTGEN_DRY_RUN}" == "true" ]]; then
git diff
fi
- name: create PR
if: ${{ !inputs.dry-run }}
uses: peter-evans/create-pull-request@v5
with:
commit-message: "[BOT] update list for ${{ matrix.python }}"
branch: update-stdlib-list-${{ matrix.python }}
base: main
branch-suffix: timestamp
title: "[BOT] update list for ${{ matrix.python }}"
body: |
This is an automated pull request, updating `${{ matrix.python }}.txt` after a detected change.
Please review manually before merging.
assignees: "woodruffw"
reviewers: "woodruffw"