Linux-pack.yml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  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. ARCH: x86_64
  17. # dockerfiles, see https://github.com/flameshot-org/flameshot-docker-images
  18. # docker images, see https://hub.docker.com/r/vitzy/flameshot
  19. # vitzy/flameshot or packpack/packpack
  20. DOCKER_REPO: vitzy/flameshot
  21. # upload services: wetransfer.com, file.io, 0x0.st
  22. UPLOAD_SERVICE: wetransfer.com
  23. jobs:
  24. deb-pack:
  25. name: ${{ matrix.dist.name }}
  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. }
  36. - {
  37. name: ubuntu-20.04,
  38. os: ubuntu,
  39. symbol: focal
  40. }
  41. steps:
  42. - name: Checkout Source code
  43. if: github.event_name == 'push'
  44. uses: actions/checkout@v2
  45. with:
  46. fetch-depth: 0
  47. ref: master
  48. - name: Checkout Source code
  49. if: github.event_name == 'pull_request'
  50. uses: actions/checkout@v2
  51. with:
  52. fetch-depth: 0
  53. ref: ${{ github.event.pull_request.head.sha }}
  54. - name: Set env & Print flameshot version
  55. shell: bash
  56. run: |
  57. last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
  58. git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
  59. git_hash=$(git rev-parse --short HEAD)
  60. echo "=======FLAMESHOT VERSION========"
  61. echo ${last_committed_tag:1}
  62. echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
  63. echo "================================"
  64. echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
  65. - name: Get packpack tool
  66. uses: actions/checkout@v2
  67. with:
  68. # flameshot-org/packpack or packpack/packpack
  69. repository: flameshot-org/packpack
  70. path: tools
  71. - name: Packaging on ${{ matrix.dist.name }}
  72. run: |
  73. cp -r $GITHUB_WORKSPACE/packaging/debian $GITHUB_WORKSPACE
  74. bash $GITHUB_WORKSPACE/tools/packpack
  75. mv $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.amd64.deb
  76. env:
  77. OS: ${{ matrix.dist.os }}
  78. DIST: ${{ matrix.dist.symbol }}
  79. - name: SHA256Sum of ${{ matrix.dist.name }} package(daily build)
  80. run: |
  81. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.amd64.deb
  82. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.amd64.deb > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.amd64.deb.sha256sum
  83. echo "=============${{ matrix.dist.name }} sha256sum download link============"
  84. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.amd64.deb.sha256sum)
  85. echo "========no operation for you can see link in the log console======="
  86. - name: Upload ${{ matrix.dist.name }} package(daily build)
  87. run: |
  88. echo "================${{ matrix.dist.name }} download link==============="
  89. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.amd64.deb)
  90. echo "======no operation for you can see link in the log console====="
  91. - name: Artifact Upload
  92. uses: actions/upload-artifact@v2
  93. with:
  94. name: Linux-distribution-artifact
  95. path: |
  96. ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.${{ matrix.dist.name }}.amd64.deb
  97. ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.${{ matrix.dist.name }}.amd64.deb.sha256sum
  98. deb-pack-extra:
  99. name: ubuntu-18.04(extra job to packaging deb)
  100. runs-on: ubuntu-20.04
  101. container:
  102. image: vitzy/flameshot:ubuntu-bionic
  103. steps:
  104. - name: Checkout Source code
  105. if: github.event_name == 'push'
  106. # Because git version < 2.18(ubuntu 18.04), so only actions/checkout@v1 can be used.
  107. # If you use actions/checkout@v2, you will have no .git folder.
  108. uses: actions/checkout@v1
  109. with:
  110. fetch-depth: 0
  111. ref: master
  112. - name: Checkout Source code
  113. if: github.event_name == 'pull_request'
  114. uses: actions/checkout@v1
  115. with:
  116. fetch-depth: 0
  117. ref: refs/pull/${{ github.event.number }}/head
  118. - name: Set env & Print flameshot version
  119. shell: bash
  120. run: |
  121. last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
  122. git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
  123. git_hash=$(git rev-parse --short HEAD)
  124. echo "=======FLAMESHOT VERSION========"
  125. echo ${last_committed_tag:1}
  126. echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
  127. echo "================================"
  128. echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
  129. - name: Install dependencies
  130. run: |
  131. apt-get -y -qq update
  132. apt-get -y --no-install-recommends install \
  133. qt5-default \
  134. qttools5-dev-tools \
  135. qttools5-dev \
  136. libqt5dbus5 \
  137. libqt5network5 \
  138. libqt5core5a \
  139. libqt5widgets5 \
  140. libqt5gui5 \
  141. libqt5svg5-dev \
  142. python3 \
  143. python3-pip
  144. - name: Prepare cmake(>=3.13.0)
  145. run: |
  146. apt-get -y autoremove cmake
  147. wget https://github.com/Kitware/CMake/releases/download/v3.18.3/cmake-3.18.3-Linux-${ARCH}.tar.gz
  148. tar -xf cmake-3.18.3-Linux-${ARCH}.tar.gz
  149. cd ./cmake-3.18.3-Linux-${ARCH}
  150. cp -r bin /usr/
  151. cp -r share /usr/
  152. cp -r doc /usr/share/
  153. cp -r man /usr/share/
  154. cd ..
  155. rm -rf cmake-3.18.3-Linux-${ARCH} cmake-3.18.3-Linux-${ARCH}.tar.gz
  156. echo "======CMAKE VERSION======"
  157. cmake --version
  158. echo "========================="
  159. - name: Packaging on ubuntu-18.04
  160. run: |
  161. cp -r $GITHUB_WORKSPACE/packaging/debian $GITHUB_WORKSPACE
  162. mkdir -p $GITHUB_WORKSPACE/build
  163. sed -e "/cmake (>= 3.13~),/d" -i $GITHUB_WORKSPACE/debian/control
  164. dpkg-buildpackage -b
  165. cp $GITHUB_WORKSPACE/../${PRODUCT}_*-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb
  166. - name: SHA256Sum of ubuntu-18.04 package(daily build)
  167. run: |
  168. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb
  169. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb.sha256sum
  170. echo "============ubuntu-18.04 sha256sum download link=============="
  171. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb.sha256sum)
  172. echo "=====no operation for you can see link in the log console====="
  173. - name: Upload ubuntu-18.04 package(daily build)
  174. run: |
  175. echo "===================ubuntu-18.04 download link=================="
  176. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb)
  177. echo "======no operation for you can see link in the log console====="
  178. - name: Artifact Upload
  179. uses: actions/upload-artifact@v2
  180. with:
  181. name: Linux-distribution-artifact
  182. path: |
  183. ${{ github.workspace }}/build/*
  184. rpm-pack:
  185. name: ${{ matrix.dist.name }}
  186. runs-on: ubuntu-20.04
  187. strategy:
  188. fail-fast: false
  189. matrix:
  190. dist:
  191. - {
  192. name: fedora-31,
  193. os: fedora,
  194. symbol: 31
  195. }
  196. - {
  197. name: fedora-32,
  198. os: fedora,
  199. symbol: 32
  200. }
  201. - {
  202. name: opensuse-leap-15.2,
  203. os: opensuse-leap,
  204. symbol: 15.2
  205. }
  206. steps:
  207. - name: Checkout Source code
  208. if: github.event_name == 'push'
  209. uses: actions/checkout@v2
  210. with:
  211. fetch-depth: 0
  212. ref: master
  213. - name: Checkout Source code
  214. if: github.event_name == 'pull_request'
  215. uses: actions/checkout@v2
  216. with:
  217. fetch-depth: 0
  218. ref: ${{ github.event.pull_request.head.sha }}
  219. - name: Set env & Print flameshot version
  220. shell: bash
  221. run: |
  222. last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
  223. git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
  224. git_hash=$(git rev-parse --short HEAD)
  225. echo "=======FLAMESHOT VERSION========"
  226. echo ${last_committed_tag:1}
  227. echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
  228. echo "================================"
  229. echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
  230. - name: Get packpack tool
  231. uses: actions/checkout@v2
  232. with:
  233. # flameshot-org/packpack or packpack/packpack
  234. repository: flameshot-org/packpack
  235. path: tools
  236. - name: Packaging on ${{ matrix.dist.name }}
  237. run: |
  238. cp -r $GITHUB_WORKSPACE/packaging/rpm $GITHUB_WORKSPACE
  239. bash $GITHUB_WORKSPACE/tools/packpack
  240. env:
  241. OS: ${{ matrix.dist.os }}
  242. DIST: ${{ matrix.dist.symbol }}
  243. - name: Package Clean
  244. if: matrix.dist.os == 'fedora'
  245. run: |
  246. rm -f ${{ github.workspace }}/build/${{ env.PRODUCT }}-debuginfo-*.rpm
  247. rm -f ${{ github.workspace }}/build/${{ env.PRODUCT }}-debugsource-*.rpm
  248. rm -f ${{ github.workspace }}/build/${{ env.PRODUCT }}-*.src.rpm
  249. rm -f ${{ github.workspace }}/build/build.log
  250. - name: SHA256Sum of ${{ matrix.dist.name }} package(daily build)
  251. if: matrix.dist.os == 'fedora'
  252. run: |
  253. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm
  254. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc${{ matrix.dist.symbol }}.${ARCH}.rpm.sha256sum
  255. echo "============${{ matrix.dist }} sha256sum download link============"
  256. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm.sha256sum)
  257. echo "=======no operation for you can see link in the log console======="
  258. - name: SHA256Sum of ${{ matrix.dist.name }} package(daily build)
  259. if: matrix.dist.os == 'opensuse-leap'
  260. run: |
  261. mv $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${ARCH}.rpm
  262. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${ARCH}.rpm
  263. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${ARCH}.rpm > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${ARCH}.rpm.sha256sum
  264. echo "============${{ matrix.dist }} sha256sum download link==========="
  265. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${ARCH}.rpm.sha256sum)
  266. echo "=======no operation for you can see link in the log console======"
  267. - name: Upload ${{ matrix.dist.name }} package(daily build)
  268. if: matrix.dist.os == 'fedora'
  269. run: |
  270. echo "================${{ matrix.dist.name }} download link==============="
  271. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm)
  272. echo "======no operation for you can see link in the log console====="
  273. - name: Upload ${{ matrix.dist.name }} package(daily build)
  274. if: matrix.dist.os == 'opensuse-leap'
  275. run: |
  276. echo "================${{ matrix.dist.name }} download link==============="
  277. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${ARCH}.rpm)
  278. echo "======no operation for you can see link in the log console====="
  279. - name: Artifact Upload
  280. if: matrix.dist.os == 'fedora'
  281. uses: actions/upload-artifact@v2
  282. with:
  283. name: Linux-distribution-artifact
  284. path: |
  285. ${{ github.workspace }}/build/
  286. - name: Artifact Upload
  287. if: matrix.dist.os == 'opensuse-leap'
  288. uses: actions/upload-artifact@v2
  289. with:
  290. name: Linux-distribution-artifact
  291. path: |
  292. ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-lp${{ matrix.dist.symbol }}.${{ env.ARCH }}.rpm
  293. ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-lp${{ matrix.dist.symbol }}.${{ env.ARCH }}.rpm.sha256sum
  294. appimage-pack:
  295. name: appimage
  296. runs-on: ubuntu-20.04
  297. steps:
  298. - name: Checkout Source code
  299. if: github.event_name == 'push'
  300. uses: actions/checkout@v2
  301. with:
  302. fetch-depth: 0
  303. ref: master
  304. - name: Checkout Source code
  305. if: github.event_name == 'pull_request'
  306. uses: actions/checkout@v2
  307. with:
  308. fetch-depth: 0
  309. ref: ${{ github.event.pull_request.head.sha }}
  310. - name: Set env & Print flameshot version
  311. shell: bash
  312. run: |
  313. last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
  314. git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
  315. git_hash=$(git rev-parse --short HEAD)
  316. echo "=======FLAMESHOT VERSION========"
  317. echo ${last_committed_tag:1}
  318. echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
  319. echo "================================"
  320. echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
  321. - name: Install Dependencies
  322. run: |
  323. sudo apt-get -y -qq update
  324. sudo apt-get -y --no-install-recommends install \
  325. cmake \
  326. extra-cmake-modules \
  327. build-essential \
  328. qt5-default \
  329. qttools5-dev-tools \
  330. qttools5-dev \
  331. libqt5dbus5 \
  332. libqt5network5 \
  333. libqt5core5a \
  334. libqt5widgets5 \
  335. libqt5gui5 \
  336. libqt5svg5-dev \
  337. appstream \
  338. hicolor-icon-theme \
  339. fcitx-frontend-qt5 \
  340. openssl \
  341. ca-certificates
  342. - name: Get go-appimage tool
  343. # Will not use linuxdeployqt anymore, because it suopprts currently still-supported mainstream distribution,
  344. # which is glibc 2.23. For more information, please see https://github.com/probonopd/linuxdeployqt/issues/340.
  345. # Will try new tool https://github.com/probonopd/go-appimage written in golang by the inventor of the AppImage format.
  346. run: |
  347. wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases -O - \
  348. | grep "appimagetool-.*-${ARCH}.AppImage" | head -n 1 | cut -d '"' -f 2) -O appimagetool
  349. chmod +x appimagetool
  350. - name: Packaging appimage
  351. run: |
  352. APPIMAGE_DST_PATH=$GITHUB_WORKSPACE/${PRODUCT}.AppDir
  353. mkdir -p ${APPIMAGE_DST_PATH}
  354. cd $GITHUB_WORKSPACE
  355. cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr
  356. make -j$(nproc) DESTDIR=${APPIMAGE_DST_PATH} install
  357. $GITHUB_WORKSPACE/appimagetool -s deploy ${APPIMAGE_DST_PATH}/usr/share/applications/org.flameshot.Flameshot.desktop
  358. mkdir -p ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts
  359. cp \
  360. /usr/lib/${ARCH}-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so \
  361. ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts/
  362. cp \
  363. $GITHUB_WORKSPACE/data/img/app/org.flameshot.Flameshot.png \
  364. ${APPIMAGE_DST_PATH}/
  365. rm ${APPIMAGE_DST_PATH}/lib/x86_64-linux-gnu/libxcb-glx.so.0
  366. VERSION=${VERSION} $GITHUB_WORKSPACE/appimagetool ${APPIMAGE_DST_PATH}
  367. mv $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage $GITHUB_WORKSPACE/Flameshot-${VERSION}.${ARCH}.AppImage
  368. - name: SHA256Sum of appimage package(daily build)
  369. run: |
  370. sha256sum $GITHUB_WORKSPACE/Flameshot-${VERSION}.${ARCH}.AppImage
  371. sha256sum $GITHUB_WORKSPACE/Flameshot-${VERSION}.${ARCH}.AppImage > $GITHUB_WORKSPACE/Flameshot-${VERSION}.${ARCH}.AppImage.sha256sum
  372. echo "================appimage sha256sum download link==============="
  373. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/Flameshot-${VERSION}.${ARCH}.AppImage.sha256sum)
  374. echo "======no operation for you can see link in the log console====="
  375. - name: Upload appimage package for daily build
  376. run: |
  377. echo "====================appimage download link====================="
  378. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/Flameshot-${VERSION}.${ARCH}.AppImage)
  379. echo "======no operation for you can see link in the log console====="
  380. - name: Artifact Upload
  381. uses: actions/upload-artifact@v2
  382. with:
  383. name: Linux-distribution-artifact
  384. path: |
  385. ${{ github.workspace }}/Flameshot-*.${{ env.ARCH }}.AppImage
  386. ${{ github.workspace }}/Flameshot-*.${{ env.ARCH }}.AppImage.sha256sum
  387. flatpak-pack:
  388. name: flatpak
  389. runs-on: ubuntu-20.04
  390. steps:
  391. - name: Checkout Source code
  392. if: github.event_name == 'push'
  393. uses: actions/checkout@v2
  394. with:
  395. fetch-depth: 0
  396. ref: master
  397. - name: Checkout Source code
  398. if: github.event_name == 'pull_request'
  399. uses: actions/checkout@v2
  400. with:
  401. fetch-depth: 0
  402. ref: ${{ github.event.pull_request.head.sha }}
  403. - name: Set env & Print flameshot version
  404. shell: bash
  405. run: |
  406. last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
  407. git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
  408. git_hash=$(git rev-parse --short HEAD)
  409. echo "=======FLAMESHOT VERSION========"
  410. echo ${last_committed_tag:1}
  411. echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
  412. echo "================================"
  413. echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
  414. - name: Setup flatpak
  415. run: |
  416. sudo apt-get -y -qq update
  417. sudo apt-get install -y flatpak flatpak-builder
  418. - name: Setup Flathub
  419. run: |
  420. flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
  421. flatpak install -y --noninteractive flathub org.kde.Sdk//5.15 org.kde.Platform//5.15
  422. - name: Packaging flatpak
  423. run: |
  424. BUNDLE="org.flameshot.Flameshot_${VERSION}_${ARCH}.flatpak"
  425. MANIFEST_PATH=$GITHUB_WORKSPACE/packaging/flatpak/org.flameshot.Flameshot.yml
  426. RUNTIME_REPO="https://flathub.org/repo/flathub.flatpakrepo"
  427. APP_ID="org.flameshot.Flameshot"
  428. BRANCH="master"
  429. flatpak-builder --user --disable-rofiles-fuse --repo=repo --force-clean flatpak_app ${MANIFEST_PATH} --install-deps-from=flathub
  430. flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH}
  431. mv $GITHUB_WORKSPACE/org.flameshot.Flameshot_${VERSION}_${ARCH}.flatpak $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.${ARCH}.flatpak
  432. - name: SHA256Sum of flatpak package(daily build)
  433. run: |
  434. sha256sum $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.${ARCH}.flatpak
  435. sha256sum $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.${ARCH}.flatpak > $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.${ARCH}.flatpak.sha256sum
  436. echo "================flatpak sha256sum download link===================="
  437. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.${ARCH}.flatpak.sha256sum)
  438. echo "========no operation for you can see link in the log console======="
  439. - name: Upload flatpak package(daily build)
  440. run: |
  441. echo "=====================flatpak download link====================="
  442. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.${ARCH}.flatpak)
  443. echo "======no operation for you can see link in the log console====="
  444. - name: Artifact Upload
  445. uses: actions/upload-artifact@v2
  446. with:
  447. name: Linux-distribution-artifact
  448. path: |
  449. ${{ github.workspace }}/org.flameshot.Flameshot-*.${{ env.ARCH }}.flatpak
  450. ${{ github.workspace }}/org.flameshot.Flameshot-*.${{ env.ARCH }}.flatpak.sha256sum
  451. snap-pack:
  452. name: snap
  453. runs-on: ubuntu-20.04
  454. steps:
  455. - name: Checkout Source code
  456. if: github.event_name == 'push'
  457. uses: actions/checkout@v2
  458. with:
  459. fetch-depth: 0
  460. ref: master
  461. - name: Checkout Source code
  462. if: github.event_name == 'pull_request'
  463. uses: actions/checkout@v2
  464. with:
  465. fetch-depth: 0
  466. ref: ${{ github.event.pull_request.head.sha }}
  467. - name: Set env & Print flameshot version
  468. shell: bash
  469. run: |
  470. last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
  471. git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
  472. git_hash=$(git rev-parse --short HEAD)
  473. echo "=======FLAMESHOT VERSION========"
  474. echo ${last_committed_tag:1}
  475. echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
  476. echo "================================"
  477. echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
  478. - name: Packaging snap
  479. uses: snapcore/action-build@v1
  480. id: snapcraft
  481. - name: Rename snap name
  482. shell: bash
  483. run: |
  484. mkdir -p $GITHUB_WORKSPACE/build
  485. cp ${{ steps.snapcraft.outputs.snap }} $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap
  486. - name: SHA256Sum of snap package(daily build)
  487. run: |
  488. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap
  489. sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap.sha256sum
  490. echo "================snap sha256sum download link=================="
  491. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap.sha256sum)
  492. echo "=====no operation for you can see link in the log console====="
  493. - name: Upload snap package(daily build)
  494. run: |
  495. echo "=======================snap download link======================"
  496. echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap)
  497. echo "======no operation for you can see link in the log console====="
  498. - name: Artifact Upload
  499. uses: actions/upload-artifact@v2
  500. with:
  501. name: Linux-distribution-artifact
  502. path: |
  503. ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.amd64.snap
  504. ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.amd64.snap.sha256sum