Skip to content

Experiment: Test Windows installer on GH action. #1991

Experiment: Test Windows installer on GH action.

Experiment: Test Windows installer on GH action. #1991

Workflow file for this run

name: Build FreeDV (Windows)
on:
push:
branches-ignore:
- 'dr-render-manual'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install WINE
run: |
sudo dpkg --add-architecture i386
sudo sh -c "curl https://dl.winehq.org/wine-builds/winehq.key | gpg --dearmor > /etc/apt/trusted.gpg.d/winehq.gpg"
sudo sh -c "apt-add-repository \"https://dl.winehq.org/wine-builds/ubuntu\""
sudo apt-get update
echo "/opt/wine-staging/bin" >> $GITHUB_PATH
sudo apt install -y --install-recommends wine-staging
#sudo apt install -y --install-recommends wine64 wine32
- name: Install required packages
shell: bash
working-directory: ${{github.workspace}}
run: sudo apt-get install nsis
- name: Configure WINE
shell: bash
working-directory: ${{github.workspace}}
run: |
WINEPREFIX=`pwd`/wine-env WINEARCH=win64 DISPLAY= winecfg /v win10
- name: Create Windows Python environment for build
shell: bash
working-directory: ${{github.workspace}}
run: |
export WINEPREFIX=`pwd`/wine-env
wget https://www.python.org/ftp/python/3.12.7/python-3.12.7-amd64.exe
Xvfb :99 -screen 0 1024x768x16 &
export DISPLAY=:99.0
wine ./python-3.12.7-amd64.exe /quiet /log c:\\python.log InstallAllUsers=1 Include_doc=0 Include_tcltk=0 || :
cat $WINEPREFIX/drive_c/python.log
wine c:\\Program\ Files\\Python312\\Scripts\\pip.exe install numpy
- name: Download MinGW LLVM
shell: bash
working-directory: ${{github.workspace}}
run: |
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20230320/llvm-mingw-20230320-ucrt-ubuntu-18.04-x86_64.tar.xz
tar xvf llvm-mingw-20230320-ucrt-ubuntu-18.04-x86_64.tar.xz
- name: Configure freedv-gui
shell: bash
working-directory: ${{github.workspace}}
run: |
export WINEPREFIX=`pwd`/wine-env
export PATH=${{github.workspace}}/llvm-mingw-20230320-ucrt-ubuntu-18.04-x86_64/bin:$PATH
mkdir build_windows
cd build_windows
cmake -DLPCNET_DISABLE=1 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/cross-compile/freedv-mingw-llvm-x86_64.cmake -DPython3_ROOT_DIR=$WINEPREFIX/drive_c/Program\ Files/Python312 ..
- name: Build freedv-gui
shell: bash
working-directory: ${{github.workspace}}/build_windows
run: |
export PATH=${{github.workspace}}/llvm-mingw-20230320-ucrt-ubuntu-18.04-x86_64/bin:$PATH
make -j6 package
- name: Rename installer
shell: bash
working-directory: ${{github.workspace}}/build_windows
run: |
mv FreeDV*.exe FreeDV.exe
- name: Stash for next step
uses: actions/upload-artifact@v4
with:
name: FreeDVSetupProgram
path: ${{github.workspace}}/build_windows/FreeDV.exe
test:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v4
with:
name: FreeDVSetupProgram
path: ${{github.workspace}}
- name: Install FreeDV on hard drive
shell: pwsh
run: |
.\FreeDV.exe /S /D=${{github.workspace}}\FreeDV-Install-Location
- name: List FreeDV folder
shell: pwsh
run: |
dir ${{github.workspace}}\FreeDV-Install-Location