Skip to content

5.2.1

5.2.1 #13

Workflow file for this run

name: release
on:
release:
types: [ created ]
env:
QT_VERSION: '6.8.0'
jobs:
macOS:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Set env
run: echo "TAG_NAME=$(bash ./dist/get-tag-name.sh)" >> $GITHUB_ENV
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
modules: qtimageformats
cache: true
cache-key-prefix: ${{ github.job }}-qt
- name: Build
run: |
mkdir build
cd build
cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_BUILD_TYPE=Release
cmake --build . --parallel
- name: Bundle
run: |
"$QT_ROOT_DIR"/bin/macdeployqt build/src/app/FedoraMediaWriter.app -qmldir=src/app/qml -executable=build/src/app/FedoraMediaWriter.app/Contents/MacOS/helper -appstore-compliant
# No idea why but macdeployqt deploys debug libs too, just remove them, maybe fix this sometimes
for i in `find build/src/app/FedoraMediaWriter.app/ -name '*.dSYM'`; do rm -fr "$i"; done
cd build/src/app/
"$QT_ROOT_DIR"/bin/macdeployqt FedoraMediaWriter.app -dmg -always-overwrite -appstore-compliant
mv FedoraMediaWriter.dmg ../../../FedoraMediaWriter-osx-${{ env.TAG_NAME }}.dmg
- name: Upload to GitHub (release)
run: |
bash dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="${{ env.TAG_NAME }}" filename="FedoraMediaWriter-osx-${{ env.TAG_NAME }}.dmg"
macOS-arm64:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Set env
run: echo "TAG_NAME=$(bash ./dist/get-tag-name.sh)" >> $GITHUB_ENV
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
modules: qtimageformats
cache: true
cache-key-prefix: ${{ github.job }}-qt
- name: Build
run: |
mkdir build
cd build
cmake .. -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_BUILD_TYPE=Release
cmake --build . --parallel
- name: Bundle
run: |
"$QT_ROOT_DIR"/bin/macdeployqt build/src/app/FedoraMediaWriter.app -qmldir=src/app/qml -executable=build/src/app/FedoraMediaWriter.app/Contents/MacOS/helper -appstore-compliant
# No idea why but macdeployqt deploys debug libs too, just remove them, maybe fix this sometimes
for i in `find build/src/app/FedoraMediaWriter.app/ -name '*.dSYM'`; do rm -fr "$i"; done
cd build/src/app/
"$QT_ROOT_DIR"/bin/macdeployqt FedoraMediaWriter.app -dmg -always-overwrite -appstore-compliant
mv FedoraMediaWriter.dmg ../../../FedoraMediaWriter-osx-arm64-${{ env.TAG_NAME }}.dmg
- name: Upload to GitHub (release)
run: |
bash dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="${{ env.TAG_NAME }}" filename="FedoraMediaWriter-osx-arm64-${{ env.TAG_NAME }}.dmg"
Windows-MSVC:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- name: Set env
run: echo "TAG_NAME=$(bash ./dist/get-tag-name.sh)" >> $env:GITHUB_ENV
- name: Install dependencies
shell: bash
run: |
choco install nsis
choco install dos2unix
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
arch: win64_msvc2022_64
cache: true
cache-key-prefix: ${{ github.job }}-qt
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build xz-utils
shell: bash
if: ${{ !steps.cache-qt.outputs.cache-hit }}
run: |
# eval "$(./dist/win/make-vs2022-env.bat)"
git clone https://git.tukaani.org/xz.git
cd xz
git checkout v5.4.5
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_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$QT_ROOT_DIR" -DBUILD_SHARED_LIBS=ON ..
cmake --build .
cmake --install .
- name: Build MediaWriter
shell: bash
run: |
# eval "$(./dist/win/make-vs2022-env.bat)"
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$QT_ROOT_DIR" ..
cmake --build .
cmake --install .
- name: Windeployqt
shell: bash
run: |
mkdir -p build/app/release
cd build/app/release
mv ../../src/app/helper.exe .
mv ../../src/app/mediawriter.exe .
cp $QT_ROOT_DIR/bin/liblzma.dll .
$QT_ROOT_DIR/bin/windeployqt.exe mediawriter.exe helper.exe liblzma.dll --verbose 2 --qmldir ../../.. --compiler-runtime --release
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
shell: bash
run: |
VERSION_STRIPPED=$(sed "s/-.*//" <<< "${{ env.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
mv dist/win/FMW-setup.exe ./"FedoraMediaWriter-win64-${{ env.TAG_NAME }}.exe"
- name: Upload to GitHub (release)
run: |
bash dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="${{ env.TAG_NAME }}" filename="FedoraMediaWriter-win64-${{ env.TAG_NAME }}.exe"
- name: Publish to WinGet
uses: vedantmgoyal9/winget-releaser@main
with:
identifier: Fedora.FedoraMediaWriter
version: ${{ env.TAG_NAME }}
token: ${{ secrets.WINGET_TOKEN }}