Linux-pack.yml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. name: Packaging(Linux)
  2. on:
  3. push:
  4. branches:
  5. - master
  6. paths-ignore:
  7. - 'README.md'
  8. - 'LICENSE'
  9. pull_request:
  10. paths-ignore:
  11. - 'README.md'
  12. - 'LICENSE'
  13. env:
  14. PRODUCT: flameshot
  15. RELEASE: 1
  16. # dockerfiles, see https://github.com/flameshot-org/flameshot-dockerfiles
  17. # docker images, see https://hub.docker.com/r/flameshotorg/ci-building-images
  18. # flameshotorg/ci-building-images or packpack/packpack
  19. DOCKER_REPO: flameshotorg/ci-building-images
  20. PACKPACK_REPO: flameshot-org/packpack
  21. # available upload services: wetransfer.com, file.io, 0x0.st
  22. UPLOAD_SERVICE: wetransfer.com
  23. jobs:
  24. deb-pack:
  25. name: Build deb on ${{ matrix.dist.name }} ${{ matrix.dist.arch }}
  26. runs-on: ubuntu-20.04
  27. strategy:
  28. fail-fast: false
  29. matrix:
  30. dist:
  31. - {
  32. name: debian-10,
  33. os: debian,
  34. symbol: buster,
  35. arch: amd64
  36. }
  37. - {
  38. name: debian-10,
  39. os: debian,
  40. symbol: buster,
  41. arch: arm64
  42. }
  43. - {
  44. name: debian-10,
  45. os: debian,
  46. symbol: buster,
  47. arch: armhf
  48. }
  49. - {
  50. name: debian-11,
  51. os: debian,
  52. symbol: bullseye,
  53. arch: amd64
  54. }
  55. - {
  56. name: debian-11,
  57. os: debian,
  58. symbol: bullseye,
  59. arch: arm64
  60. }
  61. - {
  62. name: debian-11,
  63. os: debian,
  64. symbol: bullseye,
  65. arch: armhf
  66. }
  67. - {
  68. name: ubuntu-20.04,
  69. os: ubuntu,
  70. symbol: focal,
  71. arch: amd64
  72. }
  73. - {
  74. name: ubuntu-22.04,
  75. os: ubuntu,
  76. symbol: jammy,
  77. arch: amd64
  78. }
  79. steps:
  80. - name: Enable Docker Experimental Features
  81. run: |
  82. echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
  83. mkdir -p ~/.docker
  84. echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
  85. sudo service docker restart
  86. docker version -f '{{.Client.Experimental}}'
  87. docker version -f '{{.Server.Experimental}}'
  88. docker buildx version
  89. - name: Support for ARM via QEMU's user-mode emulation
  90. # Register binfmt_misc entry for qemu-user-static
  91. # https://github.com/multiarch/qemu-user-static
  92. env:
  93. DOCKER_ARCH: ${{ matrix.dist.arch }}
  94. run: |
  95. case ${DOCKER_ARCH} in
  96. amd64|i386)
  97. QEMU_ARCH=
  98. ;;
  99. arm32*)
  100. QEMU_ARCH=arm
  101. ;;
  102. armhf)
  103. QEMU_ARCH=arm
  104. ;;
  105. arm64*)
  106. QEMU_ARCH=aarch64
  107. ;;
  108. *)
  109. QEMU_ARCH=${DOCKER_ARCH}
  110. ;;
  111. esac
  112. if [ -n "${QEMU_ARCH}" ]; then
  113. sudo apt-get -y -qq update
  114. sudo apt-get -y install qemu binfmt-support qemu-user-static
  115. docker run --rm --privileged multiarch/qemu-user-static --reset --persistent yes --credential yes
  116. cat /proc/sys/fs/binfmt_misc/qemu-${QEMU_ARCH}
  117. fi
  118. - name: Checkout Source code
  119. if: github.event_name == 'push'
  120. uses: actions/checkout@v2
  121. with:
  122. fetch-depth: 0
  123. ref: master
  124. - name: Checkout Source code
  125. if: github.event_name == 'pull_request'
  126. uses: actions/checkout@v2
  127. with:
  128. fetch-depth: 0
  129. ref: ${{ github.event.pull_request.head.sha }}
  130. - name: Set env & Print flameshot version
  131. shell: bash
  132. run: |
  133. last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
  134. git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
  135. git_hash=$(git rev-parse --short HEAD)
  136. echo "=======FLAMESHOT VERSION========"
  137. echo ${last_committed_tag:1}
  138. echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
  139. echo "================================"
  140. echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
  141. - name: Get packpack tool
  142. uses: actions/checkout@v2
  143. with:
  144. repository: ${{ env.PACKPACK_REPO }}
  145. path: tools
  146. ref: multiarch
  147. - name: Packaging on ${{ matrix.dist.name }} ${{ matrix.dist.arch }}
  148. env:
  149. OS: ${{ matrix.dist.os }}
  150. DIST: ${{ matrix.dist.symbol }}
  151. DOCKER_ARCH: ${{ matrix.dist.arch }}
  152. run: |
  153. case ${DOCKER_ARCH} in
  154. arm32v7)
  155. export ARCH=arm/v7
  156. ;;
  157. armhf)
  158. export ARCH=arm/v7
  159. ;;
  160. arm64*)
  161. export ARCH=arm64
  162. ;;
  163. *)
  164. export ARCH=${DOCKER_ARCH}
  165. ;;
  166. esac
  167. cp -r $GITHUB_WORKSPACE/packaging/debian $GITHUB_WORKSPACE
  168. bash $GITHUB_WORKSPACE/tools/packpack
  169. mv $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}_${{ matrix.dist.arch }}.deb $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb
  170. - name: In order to unset the registered formats, and unload the binaries
  171. env:
  172. DOCKER_ARCH: ${{ matrix.dist.arch }}
  173. run: |
  174. case ${DOCKER_ARCH} in
  175. amd64|i386)
  176. QEMU_ARCH=
  177. ;;
  178. arm32*)
  179. QEMU_ARCH=arm
  180. ;;
  181. arm64*)
  182. QEMU_ARCH=aarch64
  183. ;;
  184. *)
  185. QEMU_ARCH=${DOCKER_ARCH}
  186. ;;
  187. esac
  188. if [ -n "${QEMU_ARCH}" ]; then
  189. docker run --rm --privileged --volume qemu-user-static:/usr/bin:ro multiarch/qemu-user-static:register --reset
  190. fi
  191. - name: SHA256Sum of ${{ matrix.dist.name }} ${{ matrix.dist.arch }} package(daily build)
  192. run: |
  193. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb
  194. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb.sha256sum
  195. echo "=============${{ matrix.dist.name }} ${{ matrix.dist.arch }} sha256sum download link============"
  196. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb.sha256sum)
  197. echo "========no operation for you can see link in the log console======="
  198. - name: Upload ${{ matrix.dist.name }} ${{ matrix.dist.arch }} package(daily build)
  199. run: |
  200. echo "================${{ matrix.dist.name }} ${{ matrix.dist.arch }} download link==============="
  201. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb)
  202. echo "======no operation for you can see link in the log console====="
  203. - name: Artifact Upload
  204. uses: actions/upload-artifact@v2
  205. with:
  206. name: Linux-distribution-artifact
  207. path: |
  208. ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb
  209. ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb.sha256sum
  210. rpm-pack:
  211. name: Build rpm on ${{ matrix.dist.name }} ${{ matrix.dist.arch }}
  212. runs-on: ubuntu-20.04
  213. strategy:
  214. fail-fast: false
  215. matrix:
  216. dist:
  217. - {
  218. name: fedora-35,
  219. os: fedora,
  220. symbol: 35,
  221. arch: x86_64
  222. }
  223. - {
  224. name: fedora-36,
  225. os: fedora,
  226. symbol: 36,
  227. arch: x86_64
  228. }
  229. - {
  230. name: opensuse-leap-15.2,
  231. os: opensuse-leap,
  232. symbol: 15.2,
  233. arch: x86_64
  234. }
  235. steps:
  236. - name: Checkout Source code
  237. if: github.event_name == 'push'
  238. uses: actions/checkout@v2
  239. with:
  240. fetch-depth: 0
  241. ref: master
  242. - name: Checkout Source code
  243. if: github.event_name == 'pull_request'
  244. uses: actions/checkout@v2
  245. with:
  246. fetch-depth: 0
  247. ref: ${{ github.event.pull_request.head.sha }}
  248. - name: Set env & Print flameshot version
  249. shell: bash
  250. run: |
  251. last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
  252. git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
  253. git_hash=$(git rev-parse --short HEAD)
  254. echo "=======FLAMESHOT VERSION========"
  255. echo ${last_committed_tag:1}
  256. echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
  257. echo "================================"
  258. echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
  259. - name: Get packpack tool
  260. uses: actions/checkout@v2
  261. with:
  262. repository: ${{ env.PACKPACK_REPO }}
  263. path: tools
  264. ref: master
  265. - name: Packaging on ${{ matrix.dist.name }} ${{ matrix.dist.arch }}
  266. run: |
  267. cp -r $GITHUB_WORKSPACE/packaging/rpm $GITHUB_WORKSPACE
  268. bash $GITHUB_WORKSPACE/tools/packpack
  269. env:
  270. OS: ${{ matrix.dist.os }}
  271. DIST: ${{ matrix.dist.symbol }}
  272. - name: Package Clean
  273. if: matrix.dist.os == 'fedora'
  274. run: |
  275. rm -f ${{ github.workspace }}/build/${{ env.PRODUCT }}-debuginfo-*.rpm
  276. rm -f ${{ github.workspace }}/build/${{ env.PRODUCT }}-debugsource-*.rpm
  277. rm -f ${{ github.workspace }}/build/${{ env.PRODUCT }}-*.src.rpm
  278. rm -f ${{ github.workspace }}/build/build.log
  279. - name: SHA256Sum of ${{ matrix.dist.name }} ${{ matrix.dist.arch }} package(daily build)
  280. if: matrix.dist.os == 'fedora'
  281. run: |
  282. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${{ matrix.dist.arch }}.rpm
  283. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${{ matrix.dist.arch }}.rpm > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm.sha256sum
  284. echo "============${{ matrix.dist.name }} ${{ matrix.dist.arch }} sha256sum download link============"
  285. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${{ matrix.dist.arch }}.rpm.sha256sum)
  286. echo "=======no operation for you can see link in the log console======="
  287. - name: SHA256Sum of ${{ matrix.dist.name }} ${{ matrix.dist.arch }} package(daily build)
  288. if: matrix.dist.os == 'opensuse-leap'
  289. run: |
  290. mv $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${{ matrix.dist.arch }}.rpm $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm
  291. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm
  292. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm.sha256sum
  293. echo "============${{ matrix.dist.name }} ${{ matrix.dist.arch }} sha256sum download link==========="
  294. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm.sha256sum)
  295. echo "=======no operation for you can see link in the log console======"
  296. - name: Upload ${{ matrix.dist.name }} ${{ matrix.dist.arch }} package(daily build)
  297. if: matrix.dist.os == 'fedora'
  298. run: |
  299. echo "================${{ matrix.dist.name }} ${{ matrix.dist.arch }} download link==============="
  300. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${{ matrix.dist.arch }}.rpm)
  301. echo "======no operation for you can see link in the log console====="
  302. - name: Upload ${{ matrix.dist.name }} ${{ matrix.dist.arch }} package(daily build)
  303. if: matrix.dist.os == 'opensuse-leap'
  304. run: |
  305. echo "================${{ matrix.dist.name }} ${{ matrix.dist.arch }} download link==============="
  306. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm)
  307. echo "======no operation for you can see link in the log console====="
  308. - name: Artifact Upload
  309. if: matrix.dist.os == 'fedora'
  310. uses: actions/upload-artifact@v2
  311. with:
  312. name: Linux-distribution-artifact
  313. path: |
  314. ${{ github.workspace }}/build/
  315. - name: Artifact Upload
  316. if: matrix.dist.os == 'opensuse-leap'
  317. uses: actions/upload-artifact@v2
  318. with:
  319. name: Linux-distribution-artifact
  320. path: |
  321. ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-lp${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm
  322. ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-lp${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm.sha256sum
  323. appimage-pack:
  324. name: Build appimage on ${{ matrix.config.name }}
  325. runs-on: ubuntu-20.04
  326. strategy:
  327. fail-fast: false
  328. matrix:
  329. config:
  330. - {
  331. name: ubuntu-20.04,
  332. os: ubuntu,
  333. symbol: focal,
  334. arch: amd64,
  335. image_repo: flameshotorg/ci-building-images
  336. }
  337. container:
  338. image: ${{ matrix.config.image_repo }}:${{ matrix.config.os }}-${{ matrix.config.symbol }}
  339. options: --cap-add SYS_ADMIN --device /dev/fuse --security-opt apparmor:unconfined
  340. steps:
  341. - name:
  342. shell: bash
  343. run: |
  344. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  345. - name: Checkout Source code
  346. if: github.event_name == 'push'
  347. uses: actions/checkout@v2
  348. with:
  349. fetch-depth: 0
  350. ref: master
  351. - name: Checkout Source code
  352. if: github.event_name == 'pull_request'
  353. uses: actions/checkout@v2
  354. with:
  355. fetch-depth: 0
  356. ref: ${{ github.event.pull_request.head.sha }}
  357. - name: Set env & Print flameshot version
  358. shell: bash
  359. run: |
  360. last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
  361. git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
  362. git_hash=$(git rev-parse --short HEAD)
  363. echo "=======FLAMESHOT VERSION========"
  364. echo ${last_committed_tag:1}
  365. echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
  366. echo "================================"
  367. echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
  368. - name: Install Dependencies
  369. run: |
  370. sudo apt-get -y -qq update
  371. sudo apt-get -y --no-install-recommends install \
  372. python3 \
  373. python3-pip \
  374. fuse \
  375. patchelf \
  376. cmake \
  377. extra-cmake-modules \
  378. build-essential \
  379. qt5-default \
  380. qttools5-dev-tools \
  381. qttools5-dev \
  382. libqt5dbus5 \
  383. libqt5network5 \
  384. libqt5core5a \
  385. libqt5widgets5 \
  386. libqt5gui5 \
  387. libqt5svg5-dev \
  388. appstream \
  389. hicolor-icon-theme \
  390. fcitx-frontend-qt5 \
  391. openssl \
  392. ca-certificates
  393. - name: Get go-appimage tool
  394. # Will not use linuxdeployqt anymore, because it suopprts currently still-supported mainstream distribution,
  395. # which is glibc 2.23. For more information, please see https://github.com/probonopd/linuxdeployqt/issues/340.
  396. # Will try new tool https://github.com/probonopd/go-appimage written in golang by probonopd.
  397. run: |
  398. wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases -O - \
  399. | grep "appimagetool-.*-${APPIMAGETOOL_ARCH}.AppImage" | head -n 1 | cut -d '"' -f 2) -O appimagetool
  400. chmod +x appimagetool
  401. env:
  402. APPIMAGETOOL_ARCH: x86_64
  403. - name: Packaging appimage
  404. run: |
  405. APPIMAGE_DST_PATH=$GITHUB_WORKSPACE/${PRODUCT}.AppDir
  406. mkdir -p ${APPIMAGE_DST_PATH}
  407. cd $GITHUB_WORKSPACE
  408. cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DUSE_LAUNCHER_ABSOLUTE_PATH:BOOL=OFF
  409. make -j$(nproc) DESTDIR=${APPIMAGE_DST_PATH} install
  410. $GITHUB_WORKSPACE/appimagetool -s deploy ${APPIMAGE_DST_PATH}/usr/share/applications/org.flameshot.Flameshot.desktop
  411. mkdir -p ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts
  412. cp \
  413. /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so \
  414. ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts/
  415. cp \
  416. $GITHUB_WORKSPACE/data/img/app/org.flameshot.Flameshot.png \
  417. ${APPIMAGE_DST_PATH}/
  418. if [ -f "${APPIMAGE_DST_PATH}/lib/x86_64-linux-gnu/libxcb-glx.so.0" ]; then
  419. rm ${APPIMAGE_DST_PATH}/lib/x86_64-linux-gnu/libxcb-glx.so.0
  420. fi
  421. chmod +x ${APPIMAGE_DST_PATH}/usr/lib64/ld-*.so.*
  422. VERSION=${VERSION} $GITHUB_WORKSPACE/appimagetool ${APPIMAGE_DST_PATH}
  423. mv $GITHUB_WORKSPACE/Flameshot-${VERSION}-x86_64.AppImage $GITHUB_WORKSPACE/Flameshot-${VERSION}.x86_64.AppImage
  424. - name: SHA256Sum of appimage package(daily build)
  425. run: |
  426. sha256sum $GITHUB_WORKSPACE/Flameshot-${VERSION}.x86_64.AppImage
  427. sha256sum $GITHUB_WORKSPACE/Flameshot-${VERSION}.x86_64.AppImage > $GITHUB_WORKSPACE/Flameshot-${VERSION}.x86_64.AppImage.sha256sum
  428. echo "================appimage sha256sum download link==============="
  429. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/Flameshot-${VERSION}.x86_64.AppImage.sha256sum)
  430. echo "======no operation for you can see link in the log console====="
  431. - name: Upload appimage package for daily build
  432. run: |
  433. echo "====================appimage download link====================="
  434. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/Flameshot-${VERSION}.x86_64.AppImage)
  435. echo "======no operation for you can see link in the log console====="
  436. - name: Artifact Upload
  437. uses: actions/upload-artifact@v2
  438. with:
  439. name: Linux-distribution-artifact
  440. path: |
  441. ${{ github.workspace }}/Flameshot-*.x86_64.AppImage
  442. ${{ github.workspace }}/Flameshot-*.x86_64.AppImage.sha256sum
  443. flatpak-pack:
  444. name: Build flatpak on ubuntu-20.04
  445. runs-on: ubuntu-20.04
  446. steps:
  447. - name: Checkout Source code
  448. if: github.event_name == 'push'
  449. uses: actions/checkout@v2
  450. with:
  451. fetch-depth: 0
  452. ref: master
  453. - name: Checkout Source code
  454. if: github.event_name == 'pull_request'
  455. uses: actions/checkout@v2
  456. with:
  457. fetch-depth: 0
  458. ref: ${{ github.event.pull_request.head.sha }}
  459. - name: Set env & Print flameshot version
  460. shell: bash
  461. run: |
  462. last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
  463. git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
  464. git_hash=$(git rev-parse --short HEAD)
  465. echo "=======FLAMESHOT VERSION========"
  466. echo ${last_committed_tag:1}
  467. echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
  468. echo "================================"
  469. echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
  470. - name: Setup flatpak
  471. run: |
  472. sudo apt-get -y -qq update
  473. sudo apt-get install -y flatpak flatpak-builder
  474. - name: Setup Flathub
  475. run: |
  476. flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
  477. flatpak install -y --noninteractive flathub org.kde.Sdk//5.15 org.kde.Platform//5.15
  478. - name: Packaging flatpak
  479. run: |
  480. BUNDLE="org.flameshot.Flameshot_${VERSION}_x86_64.flatpak"
  481. MANIFEST_PATH=$GITHUB_WORKSPACE/packaging/flatpak/org.flameshot.Flameshot.yml
  482. RUNTIME_REPO="https://flathub.org/repo/flathub.flatpakrepo"
  483. APP_ID="org.flameshot.Flameshot"
  484. BRANCH="master"
  485. flatpak-builder --user --disable-rofiles-fuse --repo=repo --force-clean flatpak_app ${MANIFEST_PATH} --install-deps-from=flathub
  486. flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH}
  487. mv $GITHUB_WORKSPACE/org.flameshot.Flameshot_${VERSION}_x86_64.flatpak $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.x86_64.flatpak
  488. - name: SHA256Sum of flatpak package(daily build)
  489. run: |
  490. sha256sum $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.x86_64.flatpak
  491. sha256sum $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.x86_64.flatpak > $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.x86_64.flatpak.sha256sum
  492. echo "================flatpak sha256sum download link===================="
  493. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.x86_64.flatpak.sha256sum)
  494. echo "========no operation for you can see link in the log console======="
  495. - name: Upload flatpak package(daily build)
  496. run: |
  497. echo "=====================flatpak download link====================="
  498. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.x86_64.flatpak)
  499. echo "======no operation for you can see link in the log console====="
  500. - name: Artifact Upload
  501. uses: actions/upload-artifact@v2
  502. with:
  503. name: Linux-distribution-artifact
  504. path: |
  505. ${{ github.workspace }}/org.flameshot.Flameshot-*.x86_64.flatpak
  506. ${{ github.workspace }}/org.flameshot.Flameshot-*.x86_64.flatpak.sha256sum
  507. snap-pack:
  508. name: Build snap on ubuntu-20.04
  509. runs-on: ubuntu-20.04
  510. steps:
  511. - name: Checkout Source code
  512. if: github.event_name == 'push'
  513. uses: actions/checkout@v2
  514. with:
  515. fetch-depth: 0
  516. ref: master
  517. - name: Checkout Source code
  518. if: github.event_name == 'pull_request'
  519. uses: actions/checkout@v2
  520. with:
  521. fetch-depth: 0
  522. ref: ${{ github.event.pull_request.head.sha }}
  523. - name: Set env & Print flameshot version
  524. shell: bash
  525. run: |
  526. last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
  527. git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
  528. git_hash=$(git rev-parse --short HEAD)
  529. echo "=======FLAMESHOT VERSION========"
  530. echo ${last_committed_tag:1}
  531. echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
  532. echo "================================"
  533. echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
  534. - name: Packaging snap
  535. uses: snapcore/action-build@v1
  536. id: snapcraft
  537. with:
  538. snapcraft-args: --enable-experimental-extensions
  539. - name: Rename snap name
  540. shell: bash
  541. run: |
  542. mkdir -p $GITHUB_WORKSPACE/build
  543. cp ${{ steps.snapcraft.outputs.snap }} $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap
  544. - name: SHA256Sum of snap package(daily build)
  545. run: |
  546. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap
  547. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap.sha256sum
  548. echo "================snap sha256sum download link=================="
  549. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap.sha256sum)
  550. echo "=====no operation for you can see link in the log console====="
  551. - name: Upload snap package(daily build)
  552. run: |
  553. echo "=======================snap download link======================"
  554. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap)
  555. echo "======no operation for you can see link in the log console====="
  556. - name: Artifact Upload
  557. uses: actions/upload-artifact@v2
  558. with:
  559. name: Linux-distribution-artifact
  560. path: |
  561. ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.amd64.snap
  562. ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.amd64.snap.sha256sum