name: Packaging(Linux) on: push: branches: - master* paths-ignore: - 'README.md' - 'LICENSE' pull_request: branches: - master* paths-ignore: - 'README.md' - 'LICENSE' env: PRODUCT: flameshot RELEASE: 1 ARCH: x86_64 # dockerfiles, see https://github.com/flameshot-org/flameshot-docker-images # docker images, see https://hub.docker.com/r/vitzy/flameshot # vitzy/flameshot or packpack/packpack DOCKER_REPO: vitzy/flameshot # upload services: 0x0.st, file.io, transfer.sh, wetransfer.com UPLOAD_SERVICE: wetransfer.com jobs: deb-pack: runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: dist: [debian-10, ubuntu-20.04] steps: - name: Checkout Source code uses: actions/checkout@v2 with: fetch-depth: 0 # ref: master_nc_merge_upstream_test - 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 ::set-env name=VERSION::$(echo ${last_committed_tag:1}) - name: Get packpack tool uses: actions/checkout@v2 with: # flameshot-org/packpack or packpack/packpack repository: flameshot-org/packpack path: tools - name: Packaging on ${{ matrix.dist }} if: matrix.dist == 'debian-10' run: | cp -r $GITHUB_WORKSPACE/data/debian $GITHUB_WORKSPACE bash $GITHUB_WORKSPACE/tools/packpack mv $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb env: OS: debian DIST: buster - name: Packaging on ${{ matrix.dist }} if: matrix.dist == 'ubuntu-20.04' run: | pwd ls -la cp -r $GITHUB_WORKSPACE/data/debian $GITHUB_WORKSPACE bash $GITHUB_WORKSPACE/tools/packpack mv $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb env: OS: ubuntu DIST: focal - name: SHA256Sum of ${{ matrix.dist }} package(daily build) run: | sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb.sha256sum echo "=============${{ matrix.dist }} sha256sum download link============" echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb.sha256sum) echo "========no operation for you can see link in the log console=======" - name: Upload ${{ matrix.dist }} package(daily build) run: | echo "================${{ matrix.dist }} download link===============" echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb) echo "======no operation for you can see link in the log console=====" deb-pack-extra: name: ubuntu-18.04(extra job to packaging deb) runs-on: ubuntu-20.04 container: image: vitzy/flameshot:ubuntu-bionic steps: - name: Checkout Source code # Because git version < 2.18(ubuntu 18.04), so only actions/checkout@v1 can be used. # If you use actions/checkout@v2, you will have no .git folder. uses: actions/checkout@v1 with: fetch-depth: 0 # ref: master_nc_merge_upstream_test - 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 ::set-env name=VERSION::$(echo ${last_committed_tag:1}) - name: Install dependencies run: | apt-get -y -qq update apt-get -y --no-install-recommends install \ qt5-default \ qttools5-dev-tools \ qttools5-dev \ libqt5dbus5 \ libqt5network5 \ libqt5core5a \ libqt5widgets5 \ libqt5gui5 \ libqt5svg5-dev \ python3 \ python3-pip - name: Prepare cmake(>=3.13.0) run: | apt-get -y autoremove cmake wget https://github.com/Kitware/CMake/releases/download/v3.18.3/cmake-3.18.3-Linux-${ARCH}.tar.gz tar -xf cmake-3.18.3-Linux-${ARCH}.tar.gz cd ./cmake-3.18.3-Linux-${ARCH} cp -r bin /usr/ cp -r share /usr/ cp -r doc /usr/share/ cp -r man /usr/share/ cd .. rm -rf cmake-3.18.3-Linux-${ARCH} cmake-3.18.3-Linux-${ARCH}.tar.gz echo "======CMAKE VERSION======" cmake --version echo "=========================" - name: Packaging on ubuntu-18.04 run: | cp -r $GITHUB_WORKSPACE/data/debian $GITHUB_WORKSPACE mkdir -p $GITHUB_WORKSPACE/build sed -e "/cmake (>= 3.13~),/d" -i $GITHUB_WORKSPACE/debian/control dpkg-buildpackage -b cp $GITHUB_WORKSPACE/../${PRODUCT}_*_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb # cp $GITHUB_WORKSPACE/../${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb - name: SHA256Sum of ubuntu-18.04 package(daily build) run: | sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb > $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb.sha256sum echo "============ubuntu-18.04 sha256sum download link==============" echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb.sha256sum) echo "=====no operation for you can see link in the log console=====" - name: Upload ubuntu-18.04 package(daily build) run: | echo "===================ubuntu-18.04 download link==================" echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb) echo "======no operation for you can see link in the log console=====" rpm-pack: runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: dist: [fedora-31, fedora-32, opensuse-leap-15.2] steps: - name: Checkout Source code uses: actions/checkout@v2 with: fetch-depth: 0 # ref: master_nc_merge_upstream_test - 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 ::set-env name=VERSION::$(echo ${last_committed_tag:1}) - name: Get packpack tool uses: actions/checkout@v2 with: # flameshot-org/packpack or packpack/packpack repository: flameshot-org/packpack path: tools - name: Packaging on ${{ matrix.dist }} if: matrix.dist == 'fedora-31' run: | cp -r $GITHUB_WORKSPACE/data/rpm $GITHUB_WORKSPACE bash $GITHUB_WORKSPACE/tools/packpack env: OS: fedora DIST: 31 - name: Packaging on ${{ matrix.dist }} if: matrix.dist == 'fedora-32' run: | cp -r $GITHUB_WORKSPACE/data/rpm $GITHUB_WORKSPACE bash $GITHUB_WORKSPACE/tools/packpack env: OS: fedora DIST: 32 - name: Packaging on ${{ matrix.dist }} if: matrix.dist == 'opensuse-leap-15.2' run: | cp -r $GITHUB_WORKSPACE/data/rpm $GITHUB_WORKSPACE bash $GITHUB_WORKSPACE/tools/packpack env: OS: opensuse-leap DIST: 15.2 - name: SHA256Sum of ${{ matrix.dist }} package(daily build) if: startsWith(matrix.dist, 'fedora') run: | sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm.sha256sum echo "============${{ matrix.dist }} sha256sum download link============" echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm.sha256sum) echo "=======no operation for you can see link in the log console=======" - name: SHA256Sum of ${{ matrix.dist }} package(daily build) if: startsWith(matrix.dist, 'opensuse-leap') run: | sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm.sha256sum echo "============${{ matrix.dist }} sha256sum download link===========" echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm.sha256sum) echo "=======no operation for you can see link in the log console======" - name: Upload ${{ matrix.dist }} package(daily build) if: startsWith(matrix.dist, 'fedora') run: | echo "================${{ matrix.dist }} download link===============" echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm) echo "======no operation for you can see link in the log console=====" - name: Upload ${{ matrix.dist }} package(daily build) if: startsWith(matrix.dist, 'opensuse-leap') run: | echo "================${{ matrix.dist }} download link===============" echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm) echo "======no operation for you can see link in the log console=====" appimage-pack: runs-on: ubuntu-20.04 steps: - name: Checkout Source code uses: actions/checkout@v2 with: fetch-depth: 0 # ref: master_nc_merge_upstream_test - 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 ::set-env name=VERSION::$(echo ${last_committed_tag:1}) - name: Install Dependencies run: | sudo apt-get -y -qq update sudo apt-get -y --no-install-recommends install \ 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 - 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 the inventor of the AppImage format. run: | wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases -O - \ | grep "appimagetool-.*-${ARCH}.AppImage" | head -n 1 | cut -d '"' -f 2) -O appimagetool chmod +x appimagetool - name: Packaging appimage run: | APPIMAGE_DST_PATH=$GITHUB_WORKSPACE/${PRODUCT}.AppDir mkdir -p ${APPIMAGE_DST_PATH} cd $GITHUB_WORKSPACE cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr make -j$(nproc) DESTDIR=${APPIMAGE_DST_PATH} install $GITHUB_WORKSPACE/appimagetool -s deploy ${APPIMAGE_DST_PATH}/usr/share/applications/flameshot.desktop mkdir -p ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts cp \ /usr/lib/${ARCH}-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so \ ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts/ cp \ $GITHUB_WORKSPACE/data/img/app/flameshot.png \ ${APPIMAGE_DST_PATH}/ VERSION=${VERSION} $GITHUB_WORKSPACE/appimagetool ${APPIMAGE_DST_PATH} - name: SHA256Sum of appimage package(daily build) run: | sha256sum $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage sha256sum $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage > $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage.sha256sum echo "================appimage sha256sum download link===============" echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.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}-${ARCH}.AppImage) echo "======no operation for you can see link in the log console=====" # flatpak-pack: # runs-on: ubuntu-20.04 # steps: # - name: Checkout Source code # uses: actions/checkout@v2 # with: # fetch-depth: 0 ## ref: master_nc_merge_upstream_test # - 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 ::set-env name=VERSION::$(echo ${last_committed_tag:1}) # - name: Setup flatpak # run: | # sudo apt-get -y -qq update # sudo apt-get install -y flatpak flatpak-builder # - name: Setup Flathub # run: | # flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo # flatpak install -y --noninteractive flathub org.kde.Sdk//5.15 org.kde.Platform//5.15 # - name: Packaging flatpak # run: | # BUNDLE="org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak" # MANIFEST_PATH=$GITHUB_WORKSPACE/data/flatpak/org.flameshot.flameshot.yml # RUNTIME_REPO="https://flathub.org/repo/flathub.flatpakrepo" # APP_ID="org.flameshot.flameshot" # BRANCH="master_nc_merge_upstream_test" # # flatpak-builder --user --disable-rofiles-fuse --repo=repo --force-clean flatpak_app ${MANIFEST_PATH} --install-deps-from=flathub # flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH} # - name: SHA256Sum of flatpak package(daily build) # run: | # sha256sum $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak # sha256sum $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak > $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak.sha256sum # echo "================flatpak sha256sum download link====================" # echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak.sha256sum) # echo "========no operation for you can see link in the log console=======" # - name: Upload flatpak package(daily build) # run: | # echo "=====================flatpak download link=====================" # echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak) # echo "======no operation for you can see link in the log console=====" snap-pack: runs-on: ubuntu-20.04 steps: - name: Checkout Source code uses: actions/checkout@v2 with: fetch-depth: 0 # ref: master_nc_merge_upstream_test - 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 ::set-env name=VERSION::$(echo ${last_committed_tag:1}) - name: Packaging snap uses: snapcore/action-build@v1 id: snapcraft with: path: data - name: SHA256Sum of snap package(daily build) run: | sha256sum ${{ steps.snapcraft.outputs.snap }} sha256sum ${{ steps.snapcraft.outputs.snap }} > ${{ steps.snapcraft.outputs.snap }}.sha256sum echo "================snap sha256sum download link==================" echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh ${{ steps.snapcraft.outputs.snap }}.sha256sum) echo "=====no operation for you can see link in the log console=====" - name: Upload snap package(daily build) run: | echo "=======================snap download link======================" echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh ${{ steps.snapcraft.outputs.snap }}) echo "======no operation for you can see link in the log console====="