From 314db6489167d80a457835d2b26216d7ce3e6689 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Fri, 20 Oct 2023 09:58:07 +0200 Subject: [PATCH] Split and update PR check and release jobs --- .github/workflows/ccpp.yml | 492 +++++++++--------- .github/workflows/pr-check.yml | 111 ++++ .../org.fedoraproject.MediaWriter.json | 10 +- dist/win/make-vs2019-env-attribution | 2 + dist/win/make-vs2019-env.bat | 15 + src/app/releasemanager.cpp | 2 +- src/lib/isomd5/libcheckisomd5.c | 8 + 7 files changed, 385 insertions(+), 255 deletions(-) create mode 100644 .github/workflows/pr-check.yml create mode 100644 dist/win/make-vs2019-env-attribution create mode 100644 dist/win/make-vs2019-env.bat diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 94cfcc89..72e0fcc4 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -1,246 +1,246 @@ -name: Automatic build - -on: - push: - branches: - - 'main' - pull_request: - branches: - - '**' - release: - types: [ created ] - -env: - QT_VERSION: '6.5.2' - -jobs: - Linux: - if: github.event_name == 'push' || github.event_name == 'pull_request' - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - name: Install dependencies - run: | - sudo apt update - sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 binutils cmake pkg-config libx11-dev xcb libx11-xcb-dev libxkbcommon-x11-dev libssl-dev libxss-dev libxmu-dev - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - version: ${{env.QT_VERSION}} - - - name: Build - run: | - mkdir build - cd build - cmake .. -DCMAKE_INSTALL_PREFIX=/usr - make -j2 - - - Flatpak-test-build: - if: github.event_name == 'push' || github.event_name == 'pull_request' - runs-on: ubuntu-latest - container: - image: docker.io/bilelmoussaoui/flatpak-github-actions:kde-6.5 - options: --privileged - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 1 - - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 - with: - bundle: "org.fedoraproject.MediaWriter.flatpak" - manifest-path: "dist/flatpak/org.fedoraproject.MediaWriter.json" - cache-key: flatpak-builder-${{ github.sha }} - - uses: marvinpinto/action-automatic-releases@latest - if: github.event_name == 'push' - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest-flatpak" - prerelease: true - title: "Development Build (Flatpak)" - files: org.fedoraproject.MediaWriter.flatpak - - macOS: - runs-on: macos-latest - steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - version: ${{env.QT_VERSION}} - modules: qtimageformats - - name: Set env (push) - if: github.event_name == 'push' || github.event_name == 'pull_request' - run: echo "TAG_NAME=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV - - name: Set env (release) - if: github.event_name == 'release' - run: echo "TAG_NAME=$(bash ./dist/get-tag-name.sh)" >> $GITHUB_ENV - - name: Build - env: - TAG_NAME: ${{ env.TAG_NAME }} - run: | - bash dist/mac/build.sh build - - name: Insert dependencies - run: | - bash dist/mac/build.sh deps - - name: Sign (TBD) - if: github.event_name == 'release' - run: | - true # bash dist/mac/build.sh sign - - name: Package - env: - TAG_NAME: ${{ env.TAG_NAME }} - run: | - bash dist/mac/build.sh dmg - - name: Notarize (TBD) - if: github.event_name == 'release' - run: | - true # bash dist/mac/build.sh notarize - - name: Upload to GitHub (release) - if: github.event_name == 'release' - env: - TAG_NAME: ${{ env.TAG_NAME }} - run: | - bash dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="FedoraMediaWriter-osx-$TAG_NAME.unnotarized.dmg" - - name: Upload to GitHub (Development build) - if: github.event_name == 'push' - uses: marvinpinto/action-automatic-releases@latest - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest-macos" - prerelease: true - title: "Development Build (MacOS)" - files: FedoraMediaWriter-osx-${{ env.TAG_NAME }}.unnotarized.dmg - - Windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - name: Set env (push) - if: github.event_name == 'push' || github.event_name == 'release' - run: echo "TAG_NAME=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV - - name: Install dependencies - shell: bash - run: | - choco install nsis - choco install dos2unix - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - cached: ${{ steps.cache-qt.outputs.cache-hit }} - arch: win64_mingw - version: ${{env.QT_VERSION}} - - name: Build xz-utils - shell: bash - if: ${{ !steps.cache-qt.outputs.cache-hit }} - run: | - git clone https://git.tukaani.org/xz.git - cd xz - git checkout v5.2 - cd .. - sed -i 's/#include "config.h"//' xz/src/common/common_w32res.rc - sed -i 's/PACKAGE_NAME/"liblzma"/' xz/src/common/common_w32res.rc - sed -i 's/PACKAGE_URL/"https:\/\/tukaani.org\/xz\/"/' xz/src/common/common_w32res.rc - mkdir xz/build - cd xz/build - cmake -DCMAKE_SH="CMAKE_SH-NOTFOUND" -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX="$Qt6_DIR" -DBUILD_SHARED_LIBS=ON .. - mingw32-make -j2 VERBOSE=1 - mingw32-make install - - name: Build MediaWriter - shell: bash - run: | - find /d -name libstdc++-6.dll - mkdir build - cd build - cmake -DCMAKE_SH="CMAKE_SH-NOTFOUND" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$Qt6_DIR" .. - mingw32-make -j2 VERBOSE=1 - - name: Windeployqt - if: github.event_name == 'push' || github.event_name == 'release' - shell: bash - run: | - mkdir -p build/app/release - cd build/app/release - mv ../../src/app/helper.exe . - mv ../../src/app/mediawriter.exe . - $Qt6_DIR/bin/windeployqt.exe --qmldir ../../.. mediawriter.exe - cp $Qt6_DIR/bin/libstdc++-6.dll . - cp $Qt6_DIR/bin/libwinpthread-1.dll . - cp $Qt6_DIR/bin/libgcc_s_seh-1.dll . - cp $Qt6_DIR/bin/liblzma.dll . - cp /c/Program\ Files/OpenSSL/bin/*.dll . - find . -type d -not -path '*/\.*' | sed 's/^\.\///g' | sed 's@\/@\\@g' | grep -v "^.$" > uninstall.log - find . -type f -not -path '*/\.*' | sed 's/^\.\///g' | sed 's@\/@\\@g' | sort >> uninstall.log - - name: Installer - if: github.event_name == 'push' || github.event_name == 'release' - env: - TAG_NAME: ${{ env.TAG_NAME }} - shell: bash - run: | - VERSION_STRIPPED=$(sed "s/-.*//" <<< "${TAG_NAME}") - if [[ "$VERSION_STRIPPED" == "" ]]; then - VERSION_STRIPPED=0.0.0 - fi - VERSION_MAJOR=$(cut -d. -f1 <<< "${VERSION_STRIPPED}") - VERSION_MINOR=$(cut -d. -f2 <<< "${VERSION_STRIPPED}") - VERSION_BUILD=$(cut -d. -f3 <<< "${VERSION_STRIPPED}") - INSTALLED_SIZE=$(du -k -d0 "build/app/release" | cut -f1) - - cp "dist/win/mediawriter_native.nsi" "dist/win/mediawriter_native.tmp.nsi" - - sed -i "s/#!define VERSIONMAJOR/!define VERSIONMAJOR ${VERSION_MAJOR}/" "dist/win/mediawriter_native.tmp.nsi" - sed -i "s/#!define VERSIONMINOR/!define VERSIONMINOR ${VERSION_MINOR}/" "dist/win/mediawriter_native.tmp.nsi" - sed -i "s/#!define VERSIONBUILD/!define VERSIONBUILD ${VERSION_BUILD}/" "dist/win/mediawriter_native.tmp.nsi" - sed -i "s/#!define INSTALLSIZE/!define INSTALLSIZE ${INSTALLED_SIZE}/" "dist/win/mediawriter_native.tmp.nsi" - - unix2dos < "LICENSE.GPL-2" > "build/app/release/LICENSE.GPL-2.txt" - unix2dos < "LICENSE.LGPL-2" > "build/app/release/LICENSE.LGPL-2.txt" - - echo "LICENSE.GPL-2.txt" >> build/app/release/uninstall.log - echo "LICENSE.LGPL-2.txt" >> build/app/release/uninstall.log - - makensis -DCERTPATH="" -DCERTPASS="" dist/win/mediawriter_native.tmp.nsi - if [[ "$TAG_NAME" != "" ]]; then - mv dist/win/FMW-setup.exe ./"FedoraMediaWriter-win64-$TAG_NAME.exe" - else - mv dist/win/FMW-setup.exe ./"FedoraMediaWriter-win64.exe" - fi - - - name: Upload to GitHub (release) - if: github.event_name == 'release' - env: - TAG_NAME: ${{ env.TAG_NAME }} - shell: bash - run: | - bash ./dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="FedoraMediaWriter-win64-$TAG_NAME.exe" - - - name: Get version for WinGet publish (release) - id: get-version - if: github.event_name == 'release' - run: | - $WINGET_VER=$(bash ./dist/get-tag-name.sh) - echo "::set-output name=version::$WINGET_VER" - shell: bash - - - name: Publish to WinGet (release) - if: github.event_name == 'release' - uses: vedantmgoyal2009/winget-releaser@v2 - with: - identifier: Fedora.FedoraMediaWriter - version: ${{ steps.get-version.outputs.version }} - token: ${{ secrets.WINGET_TOKEN }} - - - name: Upload to GitHub (Development build) - if: github.event_name == 'push' - uses: marvinpinto/action-automatic-releases@latest - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest-windows" - prerelease: true - title: "Development Build (Windows)" - files: FedoraMediaWriter-win64.exe +# name: Automatic build +# +# on: +# push: +# branches: +# - 'main' +# pull_request: +# branches: +# - '**' +# release: +# types: [ created ] +# +# env: +# QT_VERSION: '6.5.2' +# +# jobs: +# Linux: +# if: github.event_name == 'push' || github.event_name == 'pull_request' +# runs-on: ubuntu-20.04 +# steps: +# - uses: actions/checkout@v1 +# with: +# fetch-depth: 1 +# - name: Install dependencies +# run: | +# sudo apt update +# sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 binutils cmake pkg-config libx11-dev xcb libx11-xcb-dev libxkbcommon-x11-dev libssl-dev libxss-dev libxmu-dev +# - name: Install Qt +# uses: jurplel/install-qt-action@v3 +# with: +# version: ${{env.QT_VERSION}} +# +# - name: Build +# run: | +# mkdir build +# cd build +# cmake .. -DCMAKE_INSTALL_PREFIX=/usr +# make -j2 +# +# +# Flatpak-test-build: +# if: github.event_name == 'push' || github.event_name == 'pull_request' +# runs-on: ubuntu-latest +# container: +# image: docker.io/bilelmoussaoui/flatpak-github-actions:kde-6.5 +# options: --privileged +# steps: +# - uses: actions/checkout@v2 +# with: +# fetch-depth: 1 +# - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 +# with: +# bundle: "org.fedoraproject.MediaWriter.flatpak" +# manifest-path: "dist/flatpak/org.fedoraproject.MediaWriter.json" +# cache-key: flatpak-builder-${{ github.sha }} +# - uses: marvinpinto/action-automatic-releases@latest +# if: github.event_name == 'push' +# with: +# repo_token: "${{ secrets.GITHUB_TOKEN }}" +# automatic_release_tag: "latest-flatpak" +# prerelease: true +# title: "Development Build (Flatpak)" +# files: org.fedoraproject.MediaWriter.flatpak +# +# macOS: +# runs-on: macos-latest +# steps: +# - uses: actions/checkout@v1 +# with: +# fetch-depth: 1 +# - name: Install Qt +# uses: jurplel/install-qt-action@v3 +# with: +# version: ${{env.QT_VERSION}} +# modules: qtimageformats +# - name: Set env (push) +# if: github.event_name == 'push' || github.event_name == 'pull_request' +# run: echo "TAG_NAME=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV +# - name: Set env (release) +# if: github.event_name == 'release' +# run: echo "TAG_NAME=$(bash ./dist/get-tag-name.sh)" >> $GITHUB_ENV +# - name: Build +# env: +# TAG_NAME: ${{ env.TAG_NAME }} +# run: | +# bash dist/mac/build.sh build +# - name: Insert dependencies +# run: | +# bash dist/mac/build.sh deps +# - name: Sign (TBD) +# if: github.event_name == 'release' +# run: | +# true # bash dist/mac/build.sh sign +# - name: Package +# env: +# TAG_NAME: ${{ env.TAG_NAME }} +# run: | +# bash dist/mac/build.sh dmg +# - name: Notarize (TBD) +# if: github.event_name == 'release' +# run: | +# true # bash dist/mac/build.sh notarize +# - name: Upload to GitHub (release) +# if: github.event_name == 'release' +# env: +# TAG_NAME: ${{ env.TAG_NAME }} +# run: | +# bash dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="FedoraMediaWriter-osx-$TAG_NAME.unnotarized.dmg" +# - name: Upload to GitHub (Development build) +# if: github.event_name == 'push' +# uses: marvinpinto/action-automatic-releases@latest +# with: +# repo_token: "${{ secrets.GITHUB_TOKEN }}" +# automatic_release_tag: "latest-macos" +# prerelease: true +# title: "Development Build (MacOS)" +# files: FedoraMediaWriter-osx-${{ env.TAG_NAME }}.unnotarized.dmg +# +# Windows: +# runs-on: windows-latest +# steps: +# - uses: actions/checkout@v1 +# with: +# fetch-depth: 1 +# - name: Set env (push) +# if: github.event_name == 'push' || github.event_name == 'release' +# run: echo "TAG_NAME=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV +# - name: Install dependencies +# shell: bash +# run: | +# choco install nsis +# choco install dos2unix +# - name: Install Qt +# uses: jurplel/install-qt-action@v3 +# with: +# cached: ${{ steps.cache-qt.outputs.cache-hit }} +# arch: win64_mingw +# version: ${{env.QT_VERSION}} +# - name: Build xz-utils +# shell: bash +# if: ${{ !steps.cache-qt.outputs.cache-hit }} +# run: | +# git clone https://git.tukaani.org/xz.git +# cd xz +# git checkout v5.2 +# cd .. +# sed -i 's/#include "config.h"//' xz/src/common/common_w32res.rc +# sed -i 's/PACKAGE_NAME/"liblzma"/' xz/src/common/common_w32res.rc +# sed -i 's/PACKAGE_URL/"https:\/\/tukaani.org\/xz\/"/' xz/src/common/common_w32res.rc +# mkdir xz/build +# cd xz/build +# cmake -DCMAKE_SH="CMAKE_SH-NOTFOUND" -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX="$Qt6_DIR" -DBUILD_SHARED_LIBS=ON .. +# mingw32-make -j2 VERBOSE=1 +# mingw32-make install +# - name: Build MediaWriter +# shell: bash +# run: | +# find /d -name libstdc++-6.dll +# mkdir build +# cd build +# cmake -DCMAKE_SH="CMAKE_SH-NOTFOUND" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$Qt6_DIR" .. +# mingw32-make -j2 VERBOSE=1 +# - name: Windeployqt +# if: github.event_name == 'push' || github.event_name == 'release' +# shell: bash +# run: | +# mkdir -p build/app/release +# cd build/app/release +# mv ../../src/app/helper.exe . +# mv ../../src/app/mediawriter.exe . +# $Qt6_DIR/bin/windeployqt.exe --qmldir ../../.. mediawriter.exe +# cp $Qt6_DIR/bin/libstdc++-6.dll . +# cp $Qt6_DIR/bin/libwinpthread-1.dll . +# cp $Qt6_DIR/bin/libgcc_s_seh-1.dll . +# cp $Qt6_DIR/bin/liblzma.dll . +# cp /c/Program\ Files/OpenSSL/bin/*.dll . +# find . -type d -not -path '*/\.*' | sed 's/^\.\///g' | sed 's@\/@\\@g' | grep -v "^.$" > uninstall.log +# find . -type f -not -path '*/\.*' | sed 's/^\.\///g' | sed 's@\/@\\@g' | sort >> uninstall.log +# - name: Installer +# if: github.event_name == 'push' || github.event_name == 'release' +# env: +# TAG_NAME: ${{ env.TAG_NAME }} +# shell: bash +# run: | +# VERSION_STRIPPED=$(sed "s/-.*//" <<< "${TAG_NAME}") +# if [[ "$VERSION_STRIPPED" == "" ]]; then +# VERSION_STRIPPED=0.0.0 +# fi +# VERSION_MAJOR=$(cut -d. -f1 <<< "${VERSION_STRIPPED}") +# VERSION_MINOR=$(cut -d. -f2 <<< "${VERSION_STRIPPED}") +# VERSION_BUILD=$(cut -d. -f3 <<< "${VERSION_STRIPPED}") +# INSTALLED_SIZE=$(du -k -d0 "build/app/release" | cut -f1) +# +# cp "dist/win/mediawriter_native.nsi" "dist/win/mediawriter_native.tmp.nsi" +# +# sed -i "s/#!define VERSIONMAJOR/!define VERSIONMAJOR ${VERSION_MAJOR}/" "dist/win/mediawriter_native.tmp.nsi" +# sed -i "s/#!define VERSIONMINOR/!define VERSIONMINOR ${VERSION_MINOR}/" "dist/win/mediawriter_native.tmp.nsi" +# sed -i "s/#!define VERSIONBUILD/!define VERSIONBUILD ${VERSION_BUILD}/" "dist/win/mediawriter_native.tmp.nsi" +# sed -i "s/#!define INSTALLSIZE/!define INSTALLSIZE ${INSTALLED_SIZE}/" "dist/win/mediawriter_native.tmp.nsi" +# +# unix2dos < "LICENSE.GPL-2" > "build/app/release/LICENSE.GPL-2.txt" +# unix2dos < "LICENSE.LGPL-2" > "build/app/release/LICENSE.LGPL-2.txt" +# +# echo "LICENSE.GPL-2.txt" >> build/app/release/uninstall.log +# echo "LICENSE.LGPL-2.txt" >> build/app/release/uninstall.log +# +# makensis -DCERTPATH="" -DCERTPASS="" dist/win/mediawriter_native.tmp.nsi +# if [[ "$TAG_NAME" != "" ]]; then +# mv dist/win/FMW-setup.exe ./"FedoraMediaWriter-win64-$TAG_NAME.exe" +# else +# mv dist/win/FMW-setup.exe ./"FedoraMediaWriter-win64.exe" +# fi +# +# - name: Upload to GitHub (release) +# if: github.event_name == 'release' +# env: +# TAG_NAME: ${{ env.TAG_NAME }} +# shell: bash +# run: | +# bash ./dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="FedoraMediaWriter-win64-$TAG_NAME.exe" +# +# - name: Get version for WinGet publish (release) +# id: get-version +# if: github.event_name == 'release' +# run: | +# $WINGET_VER=$(bash ./dist/get-tag-name.sh) +# echo "::set-output name=version::$WINGET_VER" +# shell: bash +# +# - name: Publish to WinGet (release) +# if: github.event_name == 'release' +# uses: vedantmgoyal2009/winget-releaser@v2 +# with: +# identifier: Fedora.FedoraMediaWriter +# version: ${{ steps.get-version.outputs.version }} +# token: ${{ secrets.WINGET_TOKEN }} +# +# - name: Upload to GitHub (Development build) +# if: github.event_name == 'push' +# uses: marvinpinto/action-automatic-releases@latest +# with: +# repo_token: "${{ secrets.GITHUB_TOKEN }}" +# automatic_release_tag: "latest-windows" +# prerelease: true +# title: "Development Build (Windows)" +# files: FedoraMediaWriter-win64.exe diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml new file mode 100644 index 00000000..f4ed285b --- /dev/null +++ b/.github/workflows/pr-check.yml @@ -0,0 +1,111 @@ +name: pr-check + +on: [pull_request] + +env: + QT_VERSION: '6.5.3' + +jobs: + Linux: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt update + sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 binutils cmake pkg-config libx11-dev xcb libx11-xcb-dev libxkbcommon-x11-dev libssl-dev libxss-dev libxmu-dev + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: ${{env.QT_VERSION}} + cache: true + cache-key-prefix: ${{ github.job }}-qt + + - name: Build + run: | + mkdir build + cd build + cmake .. -DCMAKE_INSTALL_PREFIX=/usr + make -j2 + + Flatpak: + runs-on: ubuntu-22.04 + container: + image: docker.io/bilelmoussaoui/flatpak-github-actions:kde-6.5 + options: --privileged + steps: + - uses: actions/checkout@v4 + + - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 + with: + bundle: "org.fedoraproject.MediaWriter.flatpak" + manifest-path: "dist/flatpak/org.fedoraproject.MediaWriter.json" + cache-key: flatpak-builder-${{ github.sha }} + + macOS: + runs-on: macos-13 + steps: + - uses: actions/checkout@v4 + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: ${{env.QT_VERSION}} + modules: qtimageformats + cache: true + cache-key-prefix: ${{ github.job }}-qt + + - name: Build + run: | + bash dist/mac/build.sh build + + Windows-MSVC: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + shell: bash + run: | + choco install nsis + choco install dos2unix + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: ${{env.QT_VERSION}} + arch: win64_msvc2019_64 + cache: true + cache-key-prefix: ${{ github.job }}-qt + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Build xz-utils + shell: bash + if: ${{ !steps.cache-qt.outputs.cache-hit }} + run: | + eval "$(./dist/win/make-vs2019-env.bat)" + git clone https://git.tukaani.org/xz.git + cd xz + git checkout v5.2 + sed -i 's/#include "config.h"//' src/common/common_w32res.rc + sed -i 's/PACKAGE_NAME/"liblzma"/' src/common/common_w32res.rc + sed -i 's/PACKAGE_URL/"https:\/\/tukaani.org\/xz\/"/' src/common/common_w32res.rc + mkdir build + cd build + cmake .. -GNinja -DCMAKE_INSTALL_PREFIX="$Qt6_DIR" -DBUILD_SHARED_LIBS=ON .. + cmake --build . + cmake --install . + + - name: Build MediaWriter + shell: bash + run: | + eval "$(./dist/win/make-vs2019-env.bat)" + mkdir build + cd build + cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$Qt6_DIR" .. + cmake --build . + cmake --install . diff --git a/dist/flatpak/org.fedoraproject.MediaWriter.json b/dist/flatpak/org.fedoraproject.MediaWriter.json index 1146bfce..c1404b81 100644 --- a/dist/flatpak/org.fedoraproject.MediaWriter.json +++ b/dist/flatpak/org.fedoraproject.MediaWriter.json @@ -12,18 +12,12 @@ "--share=network", "--share=ipc", "--talk-name=org.freedesktop.Notifications", - "--system-talk-name=org.freedesktop.UDisks2", - "--env=QML2_IMPORT_PATH=/app/lib/qt6/qml" - ], - "cleanup": [ - "/include", - "/lib/cmake", - "/lib/pkgconfig" + "--system-talk-name=org.freedesktop.UDisks2" ], "modules": [ { "name": "MediaWriter", - "buildsystem": "cmake", + "buildsystem": "cmake-ninja", "sources": [ { "type": "git", diff --git a/dist/win/make-vs2019-env-attribution b/dist/win/make-vs2019-env-attribution new file mode 100644 index 00000000..4d524dd9 --- /dev/null +++ b/dist/win/make-vs2019-env-attribution @@ -0,0 +1,2 @@ +Source: https://gist.github.com/vvuk/01dc8a12678d1beffaa1e26549d03b02 +Author: Vladimir Vukicevic (vvuk) diff --git a/dist/win/make-vs2019-env.bat b/dist/win/make-vs2019-env.bat new file mode 100644 index 00000000..204c871d --- /dev/null +++ b/dist/win/make-vs2019-env.bat @@ -0,0 +1,15 @@ +@ECHO OFF + +set OLDPATH=%PATH% + +call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 > NUL: + +echo export INCLUDE='%INCLUDE%' +echo export LIB='%LIB%' +echo export LIBPATH='%LIBPATH%' + +call set NEWPATH=%%PATH:%OLDPATH%=%% +set NEWPATH=%NEWPATH:C:=/c% +set NEWPATH=%NEWPATH:\=/% +set NEWPATH=%NEWPATH:;=:% +echo export PATH="%NEWPATH%:$PATH" diff --git a/src/app/releasemanager.cpp b/src/app/releasemanager.cpp index c21aa9db..ca64e891 100644 --- a/src/app/releasemanager.cpp +++ b/src/app/releasemanager.cpp @@ -926,7 +926,7 @@ void ReleaseVariant::onFileDownloaded(const QString &path, const QString &hash) if (m_progress) m_progress->setValue(size()); setStatus(DOWNLOAD_VERIFYING); - m_progress->setValue(0.0 / 0.0, 1.0); + m_progress->setValue(0.0, 1.0); if (!shaHash().isEmpty() && shaHash() != hash) { mWarning() << "Computed SHA256 hash of" << path << " - " << hash << "does not match expected" << shaHash(); diff --git a/src/lib/isomd5/libcheckisomd5.c b/src/lib/isomd5/libcheckisomd5.c index a1c74b65..35a91947 100644 --- a/src/lib/isomd5/libcheckisomd5.c +++ b/src/lib/isomd5/libcheckisomd5.c @@ -30,7 +30,11 @@ #include #include #include +#ifdef _WIN32 +#include +#else #include +#endif #include "libcheckisomd5.h" #include "md5.h" @@ -39,6 +43,10 @@ #define lseek64 lseek #endif +#ifdef _WIN32 +#define lseek64 _lseeki64 +#endif + #ifdef _WIN32 size_t getpagesize() {