Skip to content

Add mnemonics for better experience #925

Add mnemonics for better experience

Add mnemonics for better experience #925

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: 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