-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (60 loc) · 2 KB
/
build.yaml
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
name: build python for linux x64
on:
workflow_dispatch:
inputs:
py_commit:
description: "commit to checkout python to"
required: true
type: string
flags:
description: "flags to configure with"
default: ""
required: false
type: string
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
env:
WF_PY_DIR: ${{ github.workspace }}/cpython
WF_BUILD_DIR: ${{ github.workspace }}/cpython/build
WF_ZIPFILE: ${{ github.workspace }}/cpython/python-${{ github.event.inputs.py_commit }}-built.zip
steps:
- name: set env
run: |
echo "RLNAME=${{ github.event.inputs.py_commit }}-$(date +'%s')" >> $GITHUB_ENV
- name: test
run: echo "rl ${RLNAME}"
- name: checkout python
uses: actions/checkout@v4
with:
repository: python/cpython
path: cpython
ref: ${{ github.event.inputs.py_commit }}
- name: install dependencies
run: |
cd $WF_PY_DIR
mkdir ${WF_BUILD_DIR}
echo "zipfile: ${WF_ZIPFILE}"
sudo apt-get install build-essential gdb lcov pkg-config \
libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \
lzma lzma-dev tk-dev uuid-dev zlib1g-dev libmpdec-dev zip \
llvm clang
- name: compile
run: |
cd $WF_PY_DIR
CC=clang ./configure --enable-optimizations --with-lto --prefix=${WF_BUILD_DIR} ${{ github.event.inputs.flags }}
make -s -j4
make install
- name: zip
run: |
ls ${WF_BUILD_DIR}
zip -r ${WF_ZIPFILE} ${WF_BUILD_DIR}
- name: upload
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create ${RLNAME} -R TbhLovers/PythonBuilds --notes hi
gh release upload ${RLNAME} ${WF_ZIPFILE} -R TbhLovers/PythonBuilds