-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (113 loc) · 4.14 KB
/
ci.yml
File metadata and controls
140 lines (113 loc) · 4.14 KB
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
name: Python 3.11.8 32-bit Builder
on:
push:
pull_request:
workflow_dispatch:
jobs:
build-windows:
permissions:
contents: write
issues: write
pull-requests: write
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Build Python
run: . scripts\build.ps1
- name: Upload Python artifacts
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: python-windows
path: D:\a\pybuilder\pybuilder\Python-3.11.8\python-build
build-linux:
permissions:
contents: write
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y \
build-essential \
zlib1g-dev:i386 \
libncurses5-dev:i386 \
libgdbm-dev:i386 \
libnss3-dev:i386 \
libssl-dev:i386 \
libreadline-dev:i386 \
libffi-dev:i386 \
libbz2-dev:i386 \
libsqlite3-dev:i386 \
liblzma-dev:i386 \
gcc-multilib \
g++-multilib \
libexpat1-dev:i386 \
libuuid1:i386
- name: Download Python 3.11.8 source
run: |
echo "Downloading Python 3.11.8 source to $(pwd)"
wget https://www.python.org/ftp/python/3.11.8/Python-3.11.8.tgz
tar -xf Python-3.11.8.tgz
- name: Configure and build Python 3.11.8 (32-bit)
run: |
mkdir -p /tmp/python-build
cd Python-3.11.8
sudo CFLAGS="-m32" LDFLAGS="-m32" ./configure --prefix=/tmp/python-build --enable-optimizations
sudo make -j$(nproc)
sudo make altinstall
- name: Setup installation
run: |
sudo mkdir -p /tmp/python-build/lib/tmp
cd /tmp/python-build/lib/tmp
sudo ar -x ../libpython3.11.a
sudo gcc -m32 -shared -o ../libpython-3.11.8.so *.o
cd /tmp/python-build/lib
sudo rm -rf tmp
ls
# Remove unimportant files that take up lots of space
sudo rm -rf /tmp/python-build/lib/python3.11/test/
sudo rm -rf /tmp/python-build/lib/python3.11/__pycache__/
sudo rm -rf /tmp/python-build/lib/python3.11/config-3.11-x86_64-linux-gnu/
sudo rm -rf /tmp/python-build/lib/python3.11/tkinter/
sudo rm -rf /tmp/python-build/lib/python3.11/idlelib/
sudo rm -rf /tmp/python-build/lib/python3.11/turtledemo/
# Remove the static library as we've built a shared library
sudo rm /tmp/python-build/lib/libpython3.11.a
# Strip the build binaries to reduce size
sudo strip /tmp/python-build/bin/python3.11
sudo strip /tmp/python-build/lib/libpython-3.11.8.so
# Remove extra bin files that are not needed
sudo rm /tmp/python-build/bin/python3.11-config
sudo rm /tmp/python-build/bin/idle3.11
sudo rm /tmp/python-build/bin/pydoc3.11
sudo rm /tmp/python-build/bin/pip3.11
sudo rm /tmp/python-build/bin/2to3-3.11
cd /tmp
sudo tar -czf python-3.11.8-32-bit.tar.gz ./python-build
- name: Upload Python 3.11.8 (32-bit) artifact
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: python-linux
path: /tmp/python-build
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install Semantic Release
run: npm install --save-dev semantic-release @semantic-release/github @semantic-release/exec @semantic-release/changelog @semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}