Fix - github CI/CD, SSL for Windows

This commit is contained in:
Yuriy Puchkov
2020-09-28 15:28:34 +03:00
parent 24c55279d6
commit 51a9beeedd
5 changed files with 134 additions and 85 deletions

View File

@@ -3,14 +3,14 @@ name: Packaging(Linux)
on: on:
push: push:
branches: branches:
- master - master*
paths-ignore: paths-ignore:
- 'README.md' - 'README.md'
- 'LICENSE' - 'LICENSE'
pull_request: pull_request:
branches: branches:
- master - master*
paths-ignore: paths-ignore:
- 'README.md' - 'README.md'
- 'LICENSE' - 'LICENSE'
@@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
ref: master # ref: master_nc_merge_upstream_test
- name: Set env & Print flameshot version - name: Set env & Print flameshot version
shell: bash shell: bash
run: | run: |
@@ -68,6 +68,8 @@ jobs:
- name: Packaging on ${{ matrix.dist }} - name: Packaging on ${{ matrix.dist }}
if: matrix.dist == 'ubuntu-20.04' if: matrix.dist == 'ubuntu-20.04'
run: | run: |
pwd
ls -la
cp -r $GITHUB_WORKSPACE/data/debian $GITHUB_WORKSPACE cp -r $GITHUB_WORKSPACE/data/debian $GITHUB_WORKSPACE
bash $GITHUB_WORKSPACE/tools/packpack bash $GITHUB_WORKSPACE/tools/packpack
mv $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb mv $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb
@@ -99,7 +101,7 @@ jobs:
uses: actions/checkout@v1 uses: actions/checkout@v1
with: with:
fetch-depth: 0 fetch-depth: 0
ref: master # ref: master_nc_merge_upstream_test
- name: Set env & Print flameshot version - name: Set env & Print flameshot version
shell: bash shell: bash
run: | run: |
@@ -147,7 +149,8 @@ jobs:
mkdir -p $GITHUB_WORKSPACE/build mkdir -p $GITHUB_WORKSPACE/build
sed -e "/cmake (>= 3.13~),/d" -i $GITHUB_WORKSPACE/debian/control sed -e "/cmake (>= 3.13~),/d" -i $GITHUB_WORKSPACE/debian/control
dpkg-buildpackage -b dpkg-buildpackage -b
cp $GITHUB_WORKSPACE/../${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb 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) - name: SHA256Sum of ubuntu-18.04 package(daily build)
run: | 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
@@ -172,7 +175,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
ref: master # ref: master_nc_merge_upstream_test
- name: Set env & Print flameshot version - name: Set env & Print flameshot version
shell: bash shell: bash
run: | run: |
@@ -250,7 +253,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
ref: master # ref: master_nc_merge_upstream_test
- name: Set env & Print flameshot version - name: Set env & Print flameshot version
shell: bash shell: bash
run: | run: |
@@ -325,55 +328,55 @@ jobs:
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage) 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=====" echo "======no operation for you can see link in the log console====="
flatpak-pack: # flatpak-pack:
runs-on: ubuntu-20.04 # runs-on: ubuntu-20.04
steps: # steps:
- name: Checkout Source code # - name: Checkout Source code
uses: actions/checkout@v2 # uses: actions/checkout@v2
with: # with:
fetch-depth: 0 # fetch-depth: 0
ref: master ## ref: master_nc_merge_upstream_test
- name: Set env & Print flameshot version # - name: Set env & Print flameshot version
shell: bash # shell: bash
run: | # run: |
last_committed_tag=$(git tag -l --sort=-v:refname | head -1) # last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count) # git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
git_hash=$(git rev-parse --short HEAD) # git_hash=$(git rev-parse --short HEAD)
echo "=======FLAMESHOT VERSION========" # echo "=======FLAMESHOT VERSION========"
echo ${last_committed_tag:1} # echo ${last_committed_tag:1}
echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}" # echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
echo "================================" # echo "================================"
echo ::set-env name=VERSION::$(echo ${last_committed_tag:1}) # echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
- name: Setup flatpak # - name: Setup flatpak
run: | # run: |
sudo apt-get -y -qq update # sudo apt-get -y -qq update
sudo apt-get install -y flatpak flatpak-builder # sudo apt-get install -y flatpak flatpak-builder
- name: Setup Flathub # - name: Setup Flathub
run: | # run: |
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo # 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 # flatpak install -y --noninteractive flathub org.kde.Sdk//5.15 org.kde.Platform//5.15
- name: Packaging flatpak # - name: Packaging flatpak
run: | # run: |
BUNDLE="org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak" # BUNDLE="org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak"
MANIFEST_PATH=$GITHUB_WORKSPACE/data/flatpak/org.flameshot.flameshot.yml # MANIFEST_PATH=$GITHUB_WORKSPACE/data/flatpak/org.flameshot.flameshot.yml
RUNTIME_REPO="https://flathub.org/repo/flathub.flatpakrepo" # RUNTIME_REPO="https://flathub.org/repo/flathub.flatpakrepo"
APP_ID="org.flameshot.flameshot" # APP_ID="org.flameshot.flameshot"
BRANCH="master" # 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-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} # flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH}
- name: SHA256Sum of flatpak package(daily build) # - name: SHA256Sum of flatpak package(daily build)
run: | # run: |
sha256sum $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak # 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 # sha256sum $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak > $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak.sha256sum
echo "================flatpak sha256sum download link====================" # 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 $(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=======" # echo "========no operation for you can see link in the log console======="
- name: Upload flatpak package(daily build) # - name: Upload flatpak package(daily build)
run: | # run: |
echo "=====================flatpak download link=====================" # echo "=====================flatpak download link====================="
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak) # 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=====" # echo "======no operation for you can see link in the log console====="
snap-pack: snap-pack:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
@@ -382,7 +385,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
ref: master # ref: master_nc_merge_upstream_test
- name: Set env & Print flameshot version - name: Set env & Print flameshot version
shell: bash shell: bash
run: | run: |

View File

@@ -3,14 +3,14 @@ name: Packaging(Windows)
on: on:
push: push:
branches: branches:
- master - master*
paths-ignore: paths-ignore:
- 'README.md' - 'README.md'
- 'LICENSE' - 'LICENSE'
pull_request: pull_request:
branches: branches:
- master - master*
paths-ignore: paths-ignore:
- 'README.md' - 'README.md'
- 'LICENSE' - 'LICENSE'
@@ -22,6 +22,14 @@ jobs:
windows-pack: windows-pack:
name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }} name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }}
runs-on: windows-2019 runs-on: windows-2019
env:
VCINSTALLDIR: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/
Qt5_DIR: ${{ github.workspace }}\build\Qt\${{ matrix.qt_ver }}\${{ matrix.config.qt_arch_install }}\lib\cmake\Qt5\
QTDIR: ${{ github.workspace }}\build\Qt\${{ matrix.qt_ver }}\${{ matrix.config.qt_arch_install }}\
# 2020.07
VCPKG_VERSION: 56fffbe49dfb4dd8fae0940f272c5fd2b86be991
VCPKG_PACKAGES: openssl-windows
OPENSSL_ROOT_DIR: ${{ github.workspace }}\vcpkg\installed\${{ matrix.config.vcpkg_triplet }}\
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@@ -45,17 +53,12 @@ jobs:
pak_arch: win64 pak_arch: win64
} }
type: [portable, installer] type: [portable, installer]
env:
VCINSTALLDIR: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/
Qt5_DIR: ${{ github.workspace }}\build\Qt\${{ matrix.qt_ver }}\${{ matrix.config.qt_arch_install }}\lib\cmake\Qt5\
QTDIR: ${{ github.workspace }}\build\Qt\${{ matrix.qt_ver }}\${{ matrix.config.qt_arch_install }}\
steps: steps:
- name: Checkout Source code - name: Checkout Source code
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
ref: master # ref: master
- name: Set env & Print flameshot version - name: Set env & Print flameshot version
shell: bash shell: bash
@@ -69,6 +72,15 @@ jobs:
echo "================================" echo "================================"
echo ::set-env name=VERSION::$(echo ${last_committed_tag:1}) echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
- name: Restore from cache and run vcpkg
uses: lukka/run-vcpkg@v4
with:
vcpkgArguments: ${{env.VCPKG_PACKAGES}}
vcpkgDirectory: '${{ github.workspace }}\vcpkg'
appendedCacheKey: ${{ matrix.config.vcpkg_triplet }}
vcpkgGitCommitId: ${{ env.VCPKG_VERSION }}
vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }}
- name: Cache Qt - name: Cache Qt
id: cache-qt id: cache-qt
uses: actions/cache@v1 uses: actions/cache@v1
@@ -91,6 +103,8 @@ jobs:
shell: pwsh shell: pwsh
run: | run: |
cmake .. ${{matrix.config.generator}} ` cmake .. ${{matrix.config.generator}} `
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" `
-DENABLE_OPENSSL=ON `
-DCMAKE_BUILD_TYPE=Release ` -DCMAKE_BUILD_TYPE=Release `
-DRUN_IN_PLACE=${{ contains(matrix.type, 'portable') }} -DRUN_IN_PLACE=${{ contains(matrix.type, 'portable') }}
@@ -156,3 +170,8 @@ jobs:
echo "=================Windows portable download link================" echo "=================Windows portable download link================"
echo $(python $GITHUB_WORKSPACE/scripts/upload_services/transferwee.py upload $GITHUB_WORKSPACE/build/Package/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip) echo $(python $GITHUB_WORKSPACE/scripts/upload_services/transferwee.py upload $GITHUB_WORKSPACE/build/Package/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip)
echo "=====no operation for you can see link in the log console=====" echo "=====no operation for you can see link in the log console====="
- name: Artifact Upload
uses: actions/upload-artifact@v2
with:
name: Windows-artifact
path: ${{ github.workspace }}/build/Package/*

View File

@@ -2,12 +2,12 @@ name: Building(CMake)
on: on:
push: push:
branches: [ master ] branches: [ master, master_nc_merge_upstream_test ]
paths-ignore: paths-ignore:
- 'README.md' - 'README.md'
- 'LICENSE' - 'LICENSE'
pull_request: pull_request:
branches: [ master ] branches: [ master, master_nc_merge_upstream_test ]
paths-ignore: paths-ignore:
- 'README.md' - 'README.md'
- 'LICENSE' - 'LICENSE'

View File

@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.13)
# This can be read from ${PROJECT_NAME} after project() is called # This can be read from ${PROJECT_NAME} after project() is called
project( project(
flameshot flameshot
VERSION 0.8.1 VERSION 0.8.1.1
LANGUAGES CXX) LANGUAGES CXX)
set(PROJECT_NAME_CAPITALIZED "Flameshot") set(PROJECT_NAME_CAPITALIZED "Flameshot")
@@ -17,6 +17,7 @@ set(RUN_IN_PLACE ${DEFAULT_RUN_IN_PLACE} CACHE BOOL
"Run directly in source directory structure") "Run directly in source directory structure")
option(GENERATE_TS "Regenerate translation source files" OFF)
option(GENERATE_TS "Regenerate translation source files" OFF) option(GENERATE_TS "Regenerate translation source files" OFF)
include(cmake/StandardProjectSettings.cmake) include(cmake/StandardProjectSettings.cmake)

View File

@@ -117,6 +117,21 @@ target_link_libraries(
Qt5::Network Qt5::Network
Qt5::Widgets) Qt5::Widgets)
set(USE_OPENSSL FALSE)
if(ENABLE_OPENSSL)
find_package(OpenSSL)
if (OPENSSL_FOUND)
message(STATUS "OpenSSL support enabled.")
set(USE_OPENSSL TRUE)
endif()
else()
mark_as_advanced(CLEAR OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)
endif()
if(NOT USE_OPENSSL)
message(WARNING "OpenSSL is required to upload screenshot to imgur")
endif()
target_compile_definitions(flameshot PRIVATE APP_PREFIX="${CMAKE_INSTALL_PREFIX}") target_compile_definitions(flameshot PRIVATE APP_PREFIX="${CMAKE_INSTALL_PREFIX}")
target_compile_definitions(flameshot PRIVATE APP_VERSION="v${PROJECT_VERSION}") target_compile_definitions(flameshot PRIVATE APP_VERSION="v${PROJECT_VERSION}")
target_compile_definitions(flameshot PRIVATE IMGUR_CLIENT_ID="313baf0c7b4d3ff") target_compile_definitions(flameshot PRIVATE IMGUR_CLIENT_ID="313baf0c7b4d3ff")
@@ -202,6 +217,17 @@ if(WIN32)
DESTINATION bin DESTINATION bin
) )
if (ENABLE_OPENSSL)
if (EXISTS $ENV{OPENSSL_ROOT_DIR}/bin)
install(DIRECTORY $ENV{OPENSSL_ROOT_DIR}/bin/
DESTINATION bin
FILES_MATCHING PATTERN "*.dll"
)
else()
message(WARNING "Unable to find OpenSSL dlls.")
endif()
endif()
else() else()
message("Unable to find executable QTDIR/bin/windeployqt.") message("Unable to find executable QTDIR/bin/windeployqt.")
endif() endif()