-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (61 loc) · 2.32 KB
/
workflow-release-python-bin.yml
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
# 用于python 发布二进制包
name: python 发布二进制包
on:
workflow_dispatch:
jobs:
#--------
release:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 20
matrix:
python_version: [ 3.10.10 ]
steps:
# apt-get install
- name: install dependences
run: |
sudo apt-get install gcc g++ make libssl-dev openssl zlib1g zlib1g-dev libbz2-dev liblzma-dev sqlite3 libsqlite3-dev libsndfile1 build-essential libreadline-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev python3-enchant
# wget python-src
- name: get python src
run: |
wget https://www.python.org/ftp/python/${{ matrix.python_version }}/Python-${{ matrix.python_version }}.tgz
# uncompress python-src
- name: uncompress python src
run: |
tar zxvf Python-${{ matrix.python_version }}.tgz
# compile python-src
- name: compile python src
run: |
cd Python-${{ matrix.python_version }}
sudo ./configure --enable-optimizations --prefix=${{ github.workspace }}/python_${{ matrix.python_version }}
sudo make
sudo make install
# compress python-binary
- name: compress python bin
run: |
cd ${{ github.workspace }}
sudo chown -R $(whoami):$(whoami) python_${{ matrix.python_version }}
7z a python_${{ matrix.python_version }}.zip python_${{ matrix.python_version }}
# create release
- name: Create release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: python_${{ matrix.python_version }}
release_name: release python_${{ matrix.python_version }}
body: python_${{ matrix.python_version }}
draft: false
prerelease: false
# upload python-binary
- name: Upload python bin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/python_${{ matrix.python_version }}.zip
asset_name: python_${{ matrix.python_version }}.zip
asset_content_type: application/zip