Skip to content

Commit

Permalink
Merge pull request #13 from messense/collect-dll
Browse files Browse the repository at this point in the history
Collect DLLs and generate DEF file on GitHub Actions
  • Loading branch information
messense authored May 9, 2022
2 parents fe68f46 + 9176b01 commit c11d9d7
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/dll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Collect pythonXY.dll

on:
push:
pull_request:
workflow_dispatch:

jobs:
collect:
name: Collect pythonXY.dll
runs-on: windows-latest
steps:
- uses: actions/setup-python@v2
with:
python-version: "3.7"
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- uses: actions/setup-python@v2
with:
python-version: "3.11-dev"
- name: Copy pythonXY.dll
shell: bash
run: |
for VER in 3.7 3.8 3.9 3.10 3.11; do
VER_NUM=$(echo $VER | sed 's/\.//')
PREFIX=$(py -$VER -c "import sys; print(sys.base_prefix, end='')")
cp "$PREFIX/python$VER_NUM.dll" .
done
ls *.dll
- name: Upload DLLs
uses: actions/upload-artifact@v2
with:
name: dll
path: |
*.dll
42 changes: 40 additions & 2 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: Update stable_abi.toml
name: Update python.def

on:
workflow_dispatch:
workflow_run:
workflows:
- Collect pythonXY.dll
types:
- completed
schedule:
# Run every week
- cron: '0 0 * * 0'

jobs:
update:
update-stable-abi:
name: Update stable_abi.toml
runs-on: ubuntu-latest
steps:
Expand All @@ -24,9 +29,42 @@ jobs:
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
branch: update-stable-abi
delete-branch: true
add-paths: |
src/python3.def
title: 'Update python3.def using stable_abi.toml from the latest main'
commit-message: 'chore: Update python3.def using stable_abi.toml from the latest main'
body: 'Source: https://raw.githubusercontent.com/python/cpython/main/Misc/stable_abi.toml'

update-pythonxy:
name: Update pythonXY.def
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install gendef
run: |
sudo apt-get install -y mingw-w64-tools
- name: Download DLLs
uses: dawidd6/action-download-artifact@v2
with:
workflow: dll.yml
workflow_conclusion: success
- name: Generate DEF
shell: bash
run: |
set -e
for f in dll/python*.dll; do
gendef $f
done
ls -lrth *.def
mv *.def src/
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
branch: update-pythonxy
delete-branch: true
add-paths: |
src/python*.def
title: 'Update pythonXY.def'
commit-message: 'chore: Update pythonXY.def'

0 comments on commit c11d9d7

Please sign in to comment.