-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (113 loc) · 4.09 KB
/
LinuxDeb.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: LinuxDeb
on:
push:
paths-ignore:
- '**'
# - 'README.md'
pull_request:
paths-ignore:
- 'README.md'
jobs:
build:
name: Build
# 运行平台, ubuntu-latest 目前是 Ubuntu 20.04
# 参考文档 https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
runs-on: ${{ matrix.os }}
strategy:
matrix: # 矩阵配置
qt_ver: [5.15.2] # 参考: https://mirrors.cloud.tencent.com/qt/online/qtsdkrepository/linux_x64/desktop/qt5_5152
qt_target: [desktop]
qt_arch: [gcc_64]
arch: [amd64] # arm64
os: [ubuntu-20.04]
env:
targetName: Flipped
targetLowerName: flipped
targetOS: debian
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
arch: ${{ matrix.qt_arch }}
set-env: true
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: pull 3rdparty code
run: |
cd ${{github.workspace}}
git submodule init
git submodule update
- name: NameVersion
id: NameVersion
if: startsWith(github.event.ref, 'refs/tags/')
shell: pwsh
run: |
$systemInfo="${{ env.targetOS }}_${{ matrix.arch }}"
$productVersion="${{ github.ref }}".substring("refs/tags/v".length)
# $productName="${{ env.targetName }}_$productVersion_beta_$systemInfo"
$productDebName="${{ env.targetLowerName }}_$productVersion"
echo "systemInfo=$systemInfo" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "productVersion=$productVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# echo "productName=$productName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "productDebName=$productDebName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# 安装一些包 # libqt5*-dev
# sudo apt install wget tar dh-make debmake lintian cmake qtbase5-dev qt5-default libqt5x11extras5-dev libqt5svg5-dev libqt5*-dev
- name: AptInstallTool
id: AptInstallTool
if: startsWith(github.event.ref, 'refs/tags/')
shell: bash
run: |
sudo apt clean
sudo apt update
sudo apt install wget tar dh-make debmake lintian cmake devscripts qtbase5-dev qt5-default libqt5*-dev
# tag 打包 .deb,无动态库
- name: DebPackage
id: DebPackage
if: startsWith(github.event.ref, 'refs/tags/')
shell: bash
run: |
echo "-------------- debug 0 --------------"
pwd
echo $PATH
cd ..
cp -r ${{ env.targetName }} ${{ env.productDebName }}
tar -cvzf ${{ env.productDebName }}.tar.gz ${{ env.productDebName }}
echo "-------------- debug 1 --------------"
ls -al
cat >> ~/.bashrc <<EOF
DEBEMAIL="[email protected]"
DEBFULLNAME="XMuli"
export DEBEMAIL DEBFULLNAME
EOF
. ~/.bashrc
echo "-------------- debug 2 --------------"
cat ~/.bashrc
cd ${{ env.productDebName }}
pwd
ls -al
pwd
ls -al ..
# dh_make -f ../${{ env.productDebName }}.tar.gz -s -c mit -y
# https://askubuntu.com/questions/675154/dpkg-buildpackage-dpkg-source-no-upstream-tarball-found
# dpkg-buildpackage -us -uc
dpkg-buildpackage -b -rfakeroot -us -uc
echo "-------------- debug 3 --------------"
pwd
ls -al
pwd
ls -al ..
# tag上传Release
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.upload_release }}
with:
draft: false
prerelease: false
files: |
../*.deb
tag: ${{ github.ref }}
overwrite: true