build python for linux x64 #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |