forked from mohasarc/spec-mining
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (70 loc) · 2.83 KB
/
build-python.yml
File metadata and controls
86 lines (70 loc) · 2.83 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
name: Build and Package Python 3.10
permissions:
contents: write
on:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update || true
sudo apt-get install build-essential libssl-dev zlib1g-dev \
libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev \
libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev \
libffi-dev uuid-dev checkinstall
- name: Download Python 3.10
run: |
wget https://www.python.org/ftp/python/3.10.9/Python-3.10.9.tar.xz
tar -xf Python-3.10.9.tar.xz
- name: Configure Python build
run: |
cd Python-3.10.9
./configure --enable-optimizations --enable-shared
- name: Build Python
run: |
cd Python-3.10.9
make -j 8
- name: Package Python into a .deb file
run: |
cd Python-3.10.9
sudo checkinstall --pkgname=python310 --pkgversion="3.10.9" --default
- name: Rename .deb file
run: |
cd Python-3.10.9
mv ./python310_3.10.9-1_amd64.deb ./python310_3.10.9-1_amd64_${{ matrix.os }}.deb
- name: Update shared library cache
run: sudo ldconfig /usr/local/lib
- name: Upload report to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: ./Python-3.10.9/python310_3.10.9-1_amd64_${{ matrix.os }}.deb
tag_name: python3-10-9-build-${{ github.run_id }}
name: python3-10-9-build-${{ github.run_id }}
draft: false
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
append_body: false
body: |
Steps to use this version
1. Download appropriate versuin
a. ubuntu-20.04: `wget https://github.com/mohasarc/spec-mining/releases/download/python3-10-9-build-${{ github.run_id }}/python310_3.10.9-1_amd64_ubuntu-20.04.deb`
b. ubuntu-22.04: `wget https://github.com/mohasarc/spec-mining/releases/download/python3-10-9-build-${{ github.run_id }}/python310_3.10.9-1_amd64_ubuntu-22.04.deb`
2. run
a. ubuntu-20.04: `sudo dpkg -i python310_3.10.9-1_amd64_ubuntu-20.04.deb`
b. ubuntu-22.04: `sudo dpkg -i python310_3.10.9-1_amd64_ubuntu-22.04.deb`
3. run `sudo bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/python310.conf && ldconfig'`
- name: Install Python 3.10
run: |
cd Python-3.10.9
sudo apt-get install ./python310_3.10.9-1_amd64_${{ matrix.os }}.deb
- name: Verify Python installation
run: ldd /usr/local/bin/python3.10
- name: Test Python execution
run: /usr/local/bin/python3.10 -c "import sys; print(sys.version)"