Skip to content

Commit

Permalink
feat: modify debian foled control
Browse files Browse the repository at this point in the history
  • Loading branch information
XMuli committed Mar 30, 2022
1 parent cebed5f commit f6659ae
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 10 deletions.
126 changes: 126 additions & 0 deletions .github/workflows/LinuxDeb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: LinuxDeb
on:
# push代码时触发workflow
push:
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'buildToVS2019.bat'
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'buildToVS2019.bat'
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.12.11] # 参考: https://mirrors.cloud.tencent.com/qt/online/qtsdkrepository/linux_x64/desktop/qt5_51211
qt_target: [desktop]
qt_arch: [gcc_64]
os: [ubuntu-20.04] # ubuntu-18.04
env:
targetName: PicShot
targetLowerName: picshot
targetOS: debian
# ACTIONS_ALLOW_UNSECURE_COMMANDS: true

steps:
- 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 }}-x64"
$productVersion="${{ github.ref }}".substring("refs/tags/v".length)
$productName="${{ env.targetName }}-$productVersion-beta-protable-$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
# 安装一些包
- 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 qtbase5-dev qt5-default libqt5x11extras5-dev
# tag 打包 .deb,无动态库
- name: DebPackage
id: DebPackage
if: startsWith(github.event.ref, 'refs/tags/')
shell: bash
run: |
echo "-------------- debug 0 --------------"
pwd
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
4 changes: 2 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
picshot (0.1.2-1) unstable; urgency=medium

* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
* try build .deb on Linux(ubuntu 20.04)

-- XMuli <[email protected]> Sun, 27 Mar 2022 22:09:47 +0800
-- XMuli <[email protected]> Sun, 27 Mar 2022 16:16:38 +0800
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
14 changes: 10 additions & 4 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ Source: picshot
Section: unknown
Priority: optional
Maintainer: XMuli <[email protected]>
Build-Depends: debhelper-compat (= 12)
Build-Depends:
cmake (>= 3.13~),
debhelper (>= 11),
qtbase5-dev (>= 5.12.0~),
qt5-default (>= 5.12.0~),
libqt5x11extras5-dev
# qttools5-dev (>= 5.12.0~),
Standards-Version: 4.4.1
Homepage: <insert the upstream URL, if relevant>
Homepage: https://github.com/XMuli
#Vcs-Browser: https://salsa.debian.org/debian/picshot
#Vcs-Git: https://salsa.debian.org/debian/picshot.git

Package: picshot
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
Description: Open source cross-platform screenshots
Qt5-based open source cross-platform screenshot tool
7 changes: 3 additions & 4 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: picshot
Upstream-Contact: <preferred name and address to reach the upstream project>
Source: <url://example.com>
Upstream-Contact: https://github.com/XMuli/PicShot
Source: https://github.com/XMuli/PicShot

Files: *
Copyright: <years> <put author's name and email here>
<years> <likewise for another author>
Copyright: 2022 XMuli <[email protected]>
License: MIT

Files: debian/*
Expand Down
9 changes: 9 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,12 @@ source_group("wininfo" FILES ${SRCS_WININFO})
source_group("widget" FILES ${SRCS_WIDGET})
source_group("screen" FILES ${SRCS_WINSCREEN})


# CMAKE_INSTALL_PREFIX: /usr/local 或 c:/Program Files/${PROJECT_NAME}
if(APPLE)

elseif(WIN32)
# install(TARGETS ${PROJECT_NAME} RUNTIME)
else()
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION /usr/bin)
endif()

0 comments on commit f6659ae

Please sign in to comment.