Linux-pack.yml 26 KB

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