-
Notifications
You must be signed in to change notification settings - Fork 33
92 lines (79 loc) · 2.64 KB
/
build_package.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: build package
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build-rpm:
name: Run on CentOS 7
runs-on: ubuntu-latest
container:
image: "centos:7"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: |
yum -y install centos-release-scl-rh centos-release-scl
yum install rh-python38 rh-python38-python-devel -y
echo "source /opt/rh/rh-python38/enable" >/etc/profile.d/python38.sh
echo "export X_SCLS=\"rh-python38\"" >>/etc/profile.d/python38.sh
source /etc/profile.d/python38.sh
ldd --version
python3 -m pip install --upgrade pip setuptools wheel
pip3 install -r requirements3.txt
python3 --version
yum install rpm-build -y
- name: Build package
run: |
pwd
ls -lh
export RELEASE=`date +%Y%m%d%H%M`
sed -i 's/pip install -r requirements3.txt/source \/etc\/profile.d\/python38.sh\n\
curl https:\/\/bootstrap.pypa.io\/get-pip.py -o get-pip.py\n\
python3 get-pip.py\n\
pip3 uninstall urllib3\n\
pip3 install urllib3==1.26.6\n\
pip3 install -r requirements3.txt/' ./rpm/oceanbase-diagnostic-tool.spec
cat ./rpm/oceanbase-diagnostic-tool.spec
source /etc/profile.d/python38.sh
python3 -m pip install --upgrade pip setuptools wheel
cat /etc/profile.d/python38.sh
python3 --version
rpmbuild -bb ./rpm/oceanbase-diagnostic-tool.spec
- name: Find rpm
run: |
find / -name oceanbase-diagnostic-tool-*.rpm
- name: "Upload rpm"
uses: actions/upload-artifact@v3
with:
name: obdiag-rpm-packages
path: |
/github/home/rpmbuild/RPMS/x86_64/oceanbase-diagnostic-tool-*.rpm
retention-days: 3
debug: true
convert-to-deb:
needs: build-rpm
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download RPM Artifact
uses: actions/download-artifact@v3
with:
name: obdiag-rpm-packages
path: .
- name: Install Alien
run: |
sudo apt-get update
sudo apt-get install -y alien
- name: Convert RPM to DEB
run: sudo alien -k --scripts oceanbase-diagnostic-tool-*.rpm
- name: Upload DEB Artifact
uses: actions/upload-artifact@v3
with:
name: obdiag-deb-package
path: /home/runner/work/obdiag/obdiag/oceanbase-diagnostic-tool_*.deb