|
1 | | -name: build python for macos arm |
| 1 | +name: build python for linux x64 |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | workflow_dispatch: |
|
7 | 7 | description: "commit to checkout python to" |
8 | 8 | required: true |
9 | 9 | type: string |
| 10 | + flags: |
| 11 | + description: "flags to configure with" |
| 12 | + default: "" |
| 13 | + required: false |
| 14 | + type: string |
| 15 | + |
| 16 | +permissions: |
| 17 | + contents: write |
10 | 18 |
|
11 | 19 | jobs: |
12 | 20 | build: |
13 | 21 | runs-on: macos-latest |
| 22 | + env: |
| 23 | + WF_PY_DIR: ${{ github.workspace }}/cpython |
| 24 | + WF_BUILD_DIR: ${{ github.workspace }}/cpython/build |
| 25 | + WF_ZIPFILE: ${{ github.workspace }}/cpython/python-${{ github.event.inputs.py_commit }}-built.zip |
14 | 26 | steps: |
| 27 | + - name: set env |
| 28 | + run: | |
| 29 | + echo "RLNAME=${{ github.event.inputs.py_commit }}-$(date +'%s')" >> $GITHUB_ENV |
| 30 | +
|
| 31 | + - name: test |
| 32 | + run: echo "rl ${RLNAME}" |
| 33 | + |
15 | 34 | - name: checkout python |
16 | 35 | uses: actions/checkout@v4 |
17 | 36 | with: |
18 | 37 | repository: python/cpython |
19 | 38 | path: cpython |
20 | 39 | ref: ${{ github.event.inputs.py_commit }} |
21 | 40 |
|
22 | | - - name: compile |
| 41 | + - name: install dependencies |
23 | 42 | run: | |
24 | | - cd cpython |
25 | | - mkdir $(pwd)/build |
26 | | - brew install zip |
| 43 | + cd $WF_PY_DIR |
| 44 | + mkdir ${WF_BUILD_DIR} |
| 45 | + echo "zipfile: ${WF_ZIPFILE}" |
27 | 46 | # sudo apt-get install build-essential gdb lcov pkg-config \ |
28 | 47 | # libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \ |
29 | 48 | # libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \ |
30 | | - # lzma lzma-dev tk-dev uuid-dev zlib1g-dev libmpdec-dev zip |
31 | | - ./configure --prefix=$(pwd)/build |
| 49 | + # lzma lzma-dev tk-dev uuid-dev zlib1g-dev libmpdec-dev zip \ |
| 50 | + # llvm clang |
| 51 | + brew install zip |
| 52 | +
|
| 53 | + - name: compile |
| 54 | + run: | |
| 55 | + cd $WF_PY_DIR |
| 56 | + ./configure --prefix=${WF_BUILD_DIR} ${{ github.event.inputs.flags }} |
32 | 57 | make -s -j3 |
33 | 58 | make install |
34 | 59 |
|
35 | 60 | - name: zip |
36 | | - run: |
37 | | - ls |
38 | | - zip -r python-${{ github.event.inputs.py_commit }}-built.zip build |
| 61 | + run: | |
| 62 | + ls ${WF_BUILD_DIR} |
| 63 | + zip -r ${WF_ZIPFILE} ${WF_BUILD_DIR} |
39 | 64 | |
40 | 65 | - name: upload |
41 | | - uses: actions/upload-artifact@v2 |
42 | | - with: |
43 | | - name: python-${{ github.event.inputs.py_commit }}-built.zip |
44 | | - path: ./python-${{ github.event.inputs.py_commit }}-built.zip |
| 66 | + env: |
| 67 | + GH_TOKEN: ${{ github.token }} |
| 68 | + run: | |
| 69 | + gh release create ${RLNAME} -R TbhLovers/PythonBuilds --notes hi |
| 70 | + gh release upload ${RLNAME} ${WF_ZIPFILE} -R TbhLovers/PythonBuilds |
0 commit comments