Skip to content

Commit c11d9d7

Browse files
authored
Merge pull request #13 from messense/collect-dll
Collect DLLs and generate DEF file on GitHub Actions
2 parents fe68f46 + 9176b01 commit c11d9d7

File tree

2 files changed

+82
-2
lines changed

2 files changed

+82
-2
lines changed

.github/workflows/dll.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Collect pythonXY.dll
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
collect:
10+
name: Collect pythonXY.dll
11+
runs-on: windows-latest
12+
steps:
13+
- uses: actions/setup-python@v2
14+
with:
15+
python-version: "3.7"
16+
- uses: actions/setup-python@v2
17+
with:
18+
python-version: "3.8"
19+
- uses: actions/setup-python@v2
20+
with:
21+
python-version: "3.9"
22+
- uses: actions/setup-python@v2
23+
with:
24+
python-version: "3.10"
25+
- uses: actions/setup-python@v2
26+
with:
27+
python-version: "3.11-dev"
28+
- name: Copy pythonXY.dll
29+
shell: bash
30+
run: |
31+
for VER in 3.7 3.8 3.9 3.10 3.11; do
32+
VER_NUM=$(echo $VER | sed 's/\.//')
33+
PREFIX=$(py -$VER -c "import sys; print(sys.base_prefix, end='')")
34+
cp "$PREFIX/python$VER_NUM.dll" .
35+
done
36+
ls *.dll
37+
- name: Upload DLLs
38+
uses: actions/upload-artifact@v2
39+
with:
40+
name: dll
41+
path: |
42+
*.dll

.github/workflows/update.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
name: Update stable_abi.toml
1+
name: Update python.def
22

33
on:
44
workflow_dispatch:
5+
workflow_run:
6+
workflows:
7+
- Collect pythonXY.dll
8+
types:
9+
- completed
510
schedule:
611
# Run every week
712
- cron: '0 0 * * 0'
813

914
jobs:
10-
update:
15+
update-stable-abi:
1116
name: Update stable_abi.toml
1217
runs-on: ubuntu-latest
1318
steps:
@@ -24,9 +29,42 @@ jobs:
2429
- name: Create Pull Request
2530
uses: peter-evans/create-pull-request@v4
2631
with:
32+
branch: update-stable-abi
2733
delete-branch: true
2834
add-paths: |
2935
src/python3.def
3036
title: 'Update python3.def using stable_abi.toml from the latest main'
3137
commit-message: 'chore: Update python3.def using stable_abi.toml from the latest main'
3238
body: 'Source: https://raw.githubusercontent.com/python/cpython/main/Misc/stable_abi.toml'
39+
40+
update-pythonxy:
41+
name: Update pythonXY.def
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v3
45+
- name: Install gendef
46+
run: |
47+
sudo apt-get install -y mingw-w64-tools
48+
- name: Download DLLs
49+
uses: dawidd6/action-download-artifact@v2
50+
with:
51+
workflow: dll.yml
52+
workflow_conclusion: success
53+
- name: Generate DEF
54+
shell: bash
55+
run: |
56+
set -e
57+
for f in dll/python*.dll; do
58+
gendef $f
59+
done
60+
ls -lrth *.def
61+
mv *.def src/
62+
- name: Create Pull Request
63+
uses: peter-evans/create-pull-request@v4
64+
with:
65+
branch: update-pythonxy
66+
delete-branch: true
67+
add-paths: |
68+
src/python*.def
69+
title: 'Update pythonXY.def'
70+
commit-message: 'chore: Update pythonXY.def'

0 commit comments

Comments
 (0)