diff --git a/.github/workflows/Linux-pack.yml b/.github/workflows/Linux-pack.yml index 033e53eb69..9d51d14a7b 100644 --- a/.github/workflows/Linux-pack.yml +++ b/.github/workflows/Linux-pack.yml @@ -33,54 +33,54 @@ jobs: matrix: dist: - { - name: debian-10, - os: debian, - symbol: buster, - arch: amd64 - } + name: debian-10, + os: debian, + symbol: buster, + arch: amd64 + } - { - name: debian-10, - os: debian, - symbol: buster, - arch: arm64 - } + name: debian-10, + os: debian, + symbol: buster, + arch: arm64 + } - { - name: debian-10, - os: debian, - symbol: buster, - arch: armhf - } + name: debian-10, + os: debian, + symbol: buster, + arch: armhf + } - { - name: debian-11, - os: debian, - symbol: bullseye, - arch: amd64 - } + name: debian-11, + os: debian, + symbol: bullseye, + arch: amd64 + } - { - name: debian-11, - os: debian, - symbol: bullseye, - arch: arm64 - } + name: debian-11, + os: debian, + symbol: bullseye, + arch: arm64 + } - { - name: debian-11, - os: debian, - symbol: bullseye, - arch: armhf - } + name: debian-11, + os: debian, + symbol: bullseye, + arch: armhf + } - { - name: ubuntu-20.04, - os: ubuntu, - symbol: focal, - arch: amd64 - } + name: ubuntu-20.04, + os: ubuntu, + symbol: focal, + arch: amd64 + } - { - name: ubuntu-22.04, - os: ubuntu, - symbol: jammy, - arch: amd64 - } - + name: ubuntu-22.04, + os: ubuntu, + symbol: jammy, + arch: amd64 + } + steps: - name: Enable Docker Experimental Features run: | @@ -220,23 +220,23 @@ jobs: matrix: dist: - { - name: fedora-35, - os: fedora, - symbol: 35, - arch: x86_64 - } + name: fedora-35, + os: fedora, + symbol: 35, + arch: x86_64 + } - { - name: fedora-36, - os: fedora, - symbol: 36, - arch: x86_64 - } + name: fedora-36, + os: fedora, + symbol: 36, + arch: x86_64 + } - { - name: opensuse-leap-15.2, - os: opensuse-leap, - symbol: 15.2, - arch: x86_64 - } + name: opensuse-leap-15.2, + os: opensuse-leap, + symbol: 15.2, + arch: x86_64 + } steps: - name: Checkout Source code if: github.event_name == 'push' @@ -326,140 +326,140 @@ jobs: path: | ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-lp${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-lp${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm.sha256sum - appimage-pack: - name: Build appimage on ${{ matrix.config.name }} - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - config: - - { + appimage-pack: + name: Build appimage on ${{ matrix.config.name }} + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + config: + - { name: ubuntu-20.04, os: ubuntu, symbol: focal, arch: amd64, image_repo: flameshotorg/ci-building-images } - container: - image: ${{ matrix.config.image_repo }}:${{ matrix.config.os }}-${{ matrix.config.symbol }} - options: --cap-add SYS_ADMIN --device /dev/fuse --security-opt apparmor:unconfined - steps: - - name: - shell: bash - run: | - git config --global --add safe.directory "$GITHUB_WORKSPACE" - - - name: Checkout Source code - if: github.event_name == 'push' - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: master - - name: Checkout Source code - if: github.event_name == 'pull_request' - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} - - name: Set env & Print flameshot version - shell: bash - run: | - last_committed_tag=$(git tag -l --sort=-v:refname | head -1) - git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count) - git_hash=$(git rev-parse --short HEAD) - echo "=======FLAMESHOT VERSION========" - echo ${last_committed_tag:1} - echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}" - echo "================================" - echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV - - name: Install Dependencies - run: | - sudo apt-get -y -qq update - sudo apt-get -y --no-install-recommends install \ - python3 \ - python3-pip \ - fuse \ - patchelf \ - cmake \ - extra-cmake-modules \ - build-essential \ - qt5-default \ - qttools5-dev-tools \ - qttools5-dev \ - libqt5dbus5 \ - libqt5network5 \ - libqt5core5a \ - libqt5widgets5 \ - libqt5gui5 \ - libqt5svg5-dev \ - appstream \ - hicolor-icon-theme \ - fcitx-frontend-qt5 \ - openssl \ - ca-certificates \ - jq - - - name: Get go-appimage tool - # Will not use linuxdeployqt anymore, because it suopprts currently still-supported mainstream distribution, - # which is glibc 2.23. For more information, please see https://github.com/probonopd/linuxdeployqt/issues/340. - # Will try new tool https://github.com/probonopd/go-appimage written in golang by probonopd. - run: | - 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 - - chmod +x appimagetool - env: - APPIMAGETOOL_ARCH: x86_64 - - name: Packaging appimage - run: | - set -x - APPIMAGE_DST_PATH=$GITHUB_WORKSPACE/${PRODUCT}.AppDir - mkdir -p ${APPIMAGE_DST_PATH} - - cd $GITHUB_WORKSPACE - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DUSE_LAUNCHER_ABSOLUTE_PATH:BOOL=OFF - make -j$(nproc) DESTDIR=${APPIMAGE_DST_PATH} install - - $GITHUB_WORKSPACE/appimagetool -s deploy "${APPIMAGE_DST_PATH}/usr/share/applications/org.flameshot.Flameshot.desktop" - - mkdir -p ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts - cp \ - /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so \ - ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts/ - - cp \ - $GITHUB_WORKSPACE/data/img/app/org.flameshot.Flameshot.png \ - ${APPIMAGE_DST_PATH}/ - - if [ -f "${APPIMAGE_DST_PATH}/lib/x86_64-linux-gnu/libxcb-glx.so.0" ]; then - rm ${APPIMAGE_DST_PATH}/lib/x86_64-linux-gnu/libxcb-glx.so.0 - fi - - chmod +x ${APPIMAGE_DST_PATH}/usr/lib64/ld-*.so.* + container: + image: ${{ matrix.config.image_repo }}:${{ matrix.config.os }}-${{ matrix.config.symbol }} + options: --cap-add SYS_ADMIN --device /dev/fuse --security-opt apparmor:unconfined + steps: + - name: + shell: bash + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + - name: Checkout Source code + if: github.event_name == 'push' + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: master + - name: Checkout Source code + if: github.event_name == 'pull_request' + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + - name: Set env & Print flameshot version + shell: bash + run: | + last_committed_tag=$(git tag -l --sort=-v:refname | head -1) + git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count) + git_hash=$(git rev-parse --short HEAD) + echo "=======FLAMESHOT VERSION========" + echo ${last_committed_tag:1} + echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}" + echo "================================" + echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV + - name: Install Dependencies + run: | + sudo apt-get -y -qq update + sudo apt-get -y --no-install-recommends install \ + python3 \ + python3-pip \ + fuse \ + patchelf \ + cmake \ + extra-cmake-modules \ + build-essential \ + qt5-default \ + qttools5-dev-tools \ + qttools5-dev \ + libqt5dbus5 \ + libqt5network5 \ + libqt5core5a \ + libqt5widgets5 \ + libqt5gui5 \ + libqt5svg5-dev \ + appstream \ + hicolor-icon-theme \ + fcitx-frontend-qt5 \ + openssl \ + ca-certificates \ + jq - VERSION=${VERSION} $GITHUB_WORKSPACE/appimagetool "${APPIMAGE_DST_PATH}" - mv $GITHUB_WORKSPACE/Flameshot-${VERSION}-x86_64.AppImage $GITHUB_WORKSPACE/Flameshot-${VERSION}.x86_64.AppImage + - name: Get go-appimage tool + # Will not use linuxdeployqt anymore, because it suopprts currently still-supported mainstream distribution, + # which is glibc 2.23. For more information, please see https://github.com/probonopd/linuxdeployqt/issues/340. + # Will try new tool https://github.com/probonopd/go-appimage written in golang by probonopd. + run: | + 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 + + chmod +x appimagetool + env: + APPIMAGETOOL_ARCH: x86_64 + - name: Packaging appimage + run: | + set -x + APPIMAGE_DST_PATH=$GITHUB_WORKSPACE/${PRODUCT}.AppDir + mkdir -p ${APPIMAGE_DST_PATH} + + cd $GITHUB_WORKSPACE + cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DUSE_LAUNCHER_ABSOLUTE_PATH:BOOL=OFF + make -j$(nproc) DESTDIR=${APPIMAGE_DST_PATH} install + + $GITHUB_WORKSPACE/appimagetool -s deploy "${APPIMAGE_DST_PATH}/usr/share/applications/org.flameshot.Flameshot.desktop" + + mkdir -p ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts + cp \ + /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so \ + ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts/ + + cp \ + $GITHUB_WORKSPACE/data/img/app/org.flameshot.Flameshot.png \ + ${APPIMAGE_DST_PATH}/ + + if [ -f "${APPIMAGE_DST_PATH}/lib/x86_64-linux-gnu/libxcb-glx.so.0" ]; then + rm ${APPIMAGE_DST_PATH}/lib/x86_64-linux-gnu/libxcb-glx.so.0 + fi + + chmod +x ${APPIMAGE_DST_PATH}/usr/lib64/ld-*.so.* + + + VERSION=${VERSION} $GITHUB_WORKSPACE/appimagetool "${APPIMAGE_DST_PATH}" + mv $GITHUB_WORKSPACE/Flameshot-${VERSION}-x86_64.AppImage $GITHUB_WORKSPACE/Flameshot-${VERSION}.x86_64.AppImage - - name: SHA256Sum of appimage package(daily build) - run: | - cd "$GITHUB_WORKSPACE/" || { >&2 echo "Cannot cd to '$GITHUB_WORKSPACE/'!"; exit 11 ; } - sha256sum Flameshot-${VERSION}.x86_64.AppImage | tee Flameshot-${VERSION}.x86_64.AppImage.sha256sum - echo "================appimage sha256sum download link===============" - echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh Flameshot-${VERSION}.x86_64.AppImage.sha256sum) - echo "======no operation for you can see link in the log console=====" - - name: Upload appimage package for daily build - run: | - echo "====================appimage download link=====================" - echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/Flameshot-${VERSION}.x86_64.AppImage) - echo "======no operation for you can see link in the log console=====" - - name: Artifact Upload - uses: actions/upload-artifact@v3 - with: - name: Linux-distribution-artifact - path: | - ${{ github.workspace }}/Flameshot-*.x86_64.AppImage - ${{ github.workspace }}/Flameshot-*.x86_64.AppImage.sha256sum + - name: SHA256Sum of appimage package(daily build) + run: | + cd "$GITHUB_WORKSPACE/" || { >&2 echo "Cannot cd to '$GITHUB_WORKSPACE/'!"; exit 11 ; } + sha256sum Flameshot-${VERSION}.x86_64.AppImage | tee Flameshot-${VERSION}.x86_64.AppImage.sha256sum + echo "================appimage sha256sum download link===============" + echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh Flameshot-${VERSION}.x86_64.AppImage.sha256sum) + echo "======no operation for you can see link in the log console=====" + - name: Upload appimage package for daily build + run: | + echo "====================appimage download link=====================" + echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/Flameshot-${VERSION}.x86_64.AppImage) + echo "======no operation for you can see link in the log console=====" + - name: Artifact Upload + uses: actions/upload-artifact@v3 + with: + name: Linux-distribution-artifact + path: | + ${{ github.workspace }}/Flameshot-*.x86_64.AppImage + ${{ github.workspace }}/Flameshot-*.x86_64.AppImage.sha256sum flatpak-pack: name: Build flatpak on ubuntu-20.04 @@ -557,7 +557,7 @@ jobs: - name: Packaging snap uses: snapcore/action-build@v1 id: snapcraft - with: + with: snapcraft-args: --enable-experimental-extensions - name: Rename snap name shell: bash @@ -582,4 +582,4 @@ jobs: name: Linux-distribution-artifact path: | ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.amd64.snap - ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.amd64.snap.sha256sum + ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.amd64.snap.sha256sum \ No newline at end of file