Skip to content

Update CI and MacOS build script with Qt 6.5.2 and include link to Applications folder in MacOS dmg file #818

Update CI and MacOS build script with Qt 6.5.2 and include link to Applications folder in MacOS dmg file

Update CI and MacOS build script with Qt 6.5.2 and include link to Applications folder in MacOS dmg file #818

Workflow file for this run

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: Install Adwaita-qt
run: |
git clone https://github.com/FedoraQt/adwaita-qt.git adwaita-qt
cd adwaita-qt
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT6=ON
make -j2
sudo make install
- 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.4
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
#Flatpak:
#if: github.event_name == 'release'
#runs-on: ubuntu-latest
#steps:
#- uses: actions/checkout@v1
#with:
#fetch-depth: 1
#- name: Install dependencies
#run: |
#sudo apt update
#sudo apt install flatpak flatpak-builder
#- name: Install Flatpak KDE SDK
#run: |
#sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
#sudo flatpak install --system -y flathub org.kde.Platform//5.15
#sudo flatpak install --system -y flathub org.kde.Sdk//5.15
#- name: Build the Flatpak package
#run: |
#TAG_NAME=$(bash ./dist/get-tag-name.sh)
#pushd dist/flatpak
#sudo flatpak-builder --repo=flatpak-repo --force-clean flatpak-build org.fedoraproject.MediaWriter.json
#flatpak build-bundle flatpak-repo org.fedoraproject.MediaWriter.flatpak org.fedoraproject.MediaWriter
#mv org.fedoraproject.MediaWriter.flatpak ../../org.fedoraproject.MediaWriter-$TAG_NAME.flatpak
#popd
#- name: Upload to GitHub
#if: github.event_name == 'release'
#shell: bash
#run: |
#TAG_NAME=$(bash ./dist/get-tag-name.sh)
#bash ./dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="org.fedoraproject.MediaWriter-$TAG_NAME.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 == 'release'
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
if: github.event_name == 'push' || github.event_name == 'release'
env:
TAG_NAME: ${{ env.TAG_NAME }}
run: |
bash dist/mac/build.sh build
- name: Insert dependencies
if: github.event_name == 'push' || github.event_name == 'release'
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
if: github.event_name == 'push' || github.event_name == 'release'
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' || github.event_name == 'pull_request'
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 .
- 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"
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