CI: add more build strategies #231
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Workflow tuningTrainer | ||
name: QBrainwaveOSC | ||
on: | ||
pull_request: | ||
branches: [ ] | ||
push: | ||
branches: [ main ] | ||
create: | ||
tags: ['v*'] # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
workflow_dispatch: | ||
publish-www: | ||
description: 'Publish on WWW' | ||
required: false | ||
type: boolean | ||
publish-github: | ||
description: 'Publish on GitHub' | ||
required: false | ||
type: boolean | ||
env: | ||
pkgname: QBrainwaveOSC | ||
IDENTITY_NAME: ${{ secrets.IDENTITY_NAME }} | ||
# note: build and publish builds with msvc is disabled until fix problem with KISSRingBuffer | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
include: | ||
- { name: "windows-qt6-msvc", os: windows-latest, flags: '-G"Visual Studio 17 2022"', shell: 'msys2 {0}', deps-prefix: "D:/deps", aqt-os: "windows", aqt-arch: "win64_msvc2019_64", aqt-prefix: "D:/Qt", aqt-subdir: "msvc2019_64", qt-version: '6.5.1', msystem: 'UCRT64', build-fftw: true } | ||
- { name: "windows-qt5-msvc", os: windows-latest, flags: '-G"Visual Studio 17 2022"', shell: 'msys2 {0}', deps-prefix: "D:/deps", aqt-os: "windows", aqt-arch: "win64_msvc2019_64", aqt-prefix: "D:/Qt", aqt-subdir: "msvc2019_64", qt-version: '5.12.12', msystem: 'UCRT64', build-fftw: true } | ||
- { name: "windows-qt6-mingw", os: windows-latest, flags: "", shell: 'msys2 {0}', deps-prefix: "D:/deps", aqt-os: "none", aqt-arch: "win64_msvc2019_64", aqt-prefix: "D:/Qt", aqt-subdir: "msvc2019_64", qt-version: '6.5.1', msystem: 'UCRT64', build-fftw: false } | ||
- { name: "windows-qt5-mingw", os: windows-latest, flags: "", shell: 'msys2 {0}', deps-prefix: "D:/deps", aqt-os: "none", aqt-arch: "win64_mingw73", aqt-prefix: "D:/Qt", aqt-subdir: "mingw73_64", qt-version: '5.12.12', msystem: 'MINGW64', build-fftw: false } | ||
- { name: "linux-qt6", os: ubuntu-latest, flags: "", shell: 'bash', deps-prefix: "/home/runner/deps", aqt-os: "none", aqt-arch: "gcc_64", aqt-prefix: "/home/runner/Qt", aqt-subdir: "gcc_64", qt-version: '6.5.1', build-fftw: false} | ||
- { name: "linux-qt5", os: ubuntu-latest, flags: "", shell: 'bash', deps-prefix: "/home/runner/deps", aqt-os: "none", aqt-arch: "gcc_64", aqt-prefix: "/home/runner/Qt", aqt-subdir: "gcc_64", qt-version: '6.5.1', build-fftw: false} | ||
- { name: "macos-qt6-universal", os: macos-latest, flags: "-DCMAKE_OSX_ARCHITECTURES=\"x86_64;arm64\"", shell: 'bash', deps-prefix: "/Users/runner/deps", aqt-os: "mac", aqt-arch: "", aqt-prefix: "/Users/runner/Qt", aqt-subdir: "macos", qt-version: '6.5.1', build-fftw: true} | ||
- { name: "macos-qt5-legacy", os: macos-latest, flags: "-DCMAKE_OSX_DEPLOYMENT_TARGET=\"10.13\" -DCMAKE_OSX_ARCHITECTURES=\"x86_64\"", shell: 'bash', deps-prefix: "/Users/runner/deps", aqt-os: "mac", aqt-arch: "", aqt-prefix: "/Users/runner/Qt", aqt-subdir: "clang_64", qt-version: '5.15.2', build-fftw: true } | ||
runs-on: ${{matrix.os}} | ||
defaults: | ||
run: | ||
shell: ${{matrix.shell}} | ||
steps: | ||
- name: Install the Apple certificate and provisioning profile | ||
if: ${{runner.os == 'macOS'}} | ||
env: | ||
P12_CERTIFICATE_BASE64: ${{ secrets.P12_CERTIFICATE_BASE64 }} | ||
P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | ||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | ||
run: | | ||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | ||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | ||
echo -n "$P12_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | ||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | ||
security default-keychain -s $KEYCHAIN_PATH | ||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH -T /usr/bin/codesign -T /usr/bin/productsign | ||
security list-keychain -d user -s $KEYCHAIN_PATH | ||
security set-key-partition-list -S apple-tool:,apple: -s -k $KEYCHAIN_PASSWORD $KEYCHAIN_PATH | ||
security find-identity | ||
- if: ${{runner.os == 'Windows'}} | ||
name: Install MinGW | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: ${{ matrix.msystem }} | ||
update: true | ||
install: | | ||
base base-devel p7zip zip git | ||
- if: ${{runner.os == 'Windows'}} | ||
name: Prepare MinGW | ||
run: | | ||
pacman -S --noconfirm \ | ||
${MINGW_PACKAGE_PREFIX}-toolchain \ | ||
${MINGW_PACKAGE_PREFIX}-python-pip \ | ||
${MINGW_PACKAGE_PREFIX}-python-distutils-extra \ | ||
${MINGW_PACKAGE_PREFIX}-python-psutil \ | ||
${MINGW_PACKAGE_PREFIX}-python-defusedxml \ | ||
${MINGW_PACKAGE_PREFIX}-python-wheel \ | ||
${MINGW_PACKAGE_PREFIX}-python-patch-ng \ | ||
${MINGW_PACKAGE_PREFIX}-cmake \ | ||
${MINGW_PACKAGE_PREFIX}-gles-headers \ | ||
${MINGW_PACKAGE_PREFIX}-glew \ | ||
${MINGW_PACKAGE_PREFIX}-glfw \ | ||
${MINGW_PACKAGE_PREFIX}-angleproject \ | ||
${MINGW_PACKAGE_PREFIX}-nsis | ||
- name: Setup windows env | ||
if: ${{runner.os == 'Windows'}} | ||
run: | | ||
echo "::notify:: Upgrading pip" | ||
python3 -m pip install -U pip | ||
- name: Install Linux Dependencies | ||
if: ${{runner.os == 'Linux'}} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y cmake-extras libasound2-dev \ | ||
libegl1-mesa-dev libfuse2 libpulse-dev | ||
sudo apt-get install -y libunwind-dev \ | ||
libgstreamer1.0-dev \ | ||
libgstreamer-plugins-base1.0-0 \ | ||
libgstreamer-plugins-base1.0-dev \ | ||
gstreamer1.0-libav \ | ||
gstreamer1.0-plugins-good \ | ||
gstreamer1.0-plugins-bad | ||
sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 \ | ||
libxcb-cursor0 libxcb-cursor-dev \ | ||
libxcb-keysyms1-dev libxcb-randr0 \ | ||
libxcb-render-util0 libxcb-shape0 | ||
- name: Create empty dependencies directory | ||
run: | | ||
mkdir -p ${{ matrix.deps-prefix }} | ||
- name: Prepare Packages names | ||
run: | | ||
PACKAGE_NAME=${{env.pkgname}}-${{matrix.name}} | ||
echo "PACKAGE_NAME=$PACKAGE_NAME" >> ${GITHUB_ENV} | ||
- name: Prepare workdir (UNIX) | ||
if: ${{runner.os != 'Windows'}} | ||
run: | | ||
export WORKDIR="${{github.workspace}}" | ||
export AQTPATH="${{matrix.aqt-prefix}}" | ||
export DEPSPATH="${{matrix.deps-prefix}}" | ||
echo "WORKDIR=${WORKDIR}" >> $GITHUB_ENV | ||
echo "AQTPATH=${AQTPATH}" >> $GITHUB_ENV | ||
echo "DEPSPATH=${DEPSPATH}" >> $GITHUB_ENV | ||
- name: Prepare workdir (MINGW) | ||
if: ${{runner.os == 'Windows'}} | ||
run: | | ||
export WORKDIR="$(cygpath -m "${{github.workspace}}")" | ||
export AQTPATH="$(cygpath -m "${{matrix.aqt-prefix}}")" | ||
export DEPSPATH="$(cygpath -m "${{matrix.deps-prefix}}")" | ||
echo "WORKDIR=${WORKDIR}" >> $GITHUB_ENV | ||
echo "AQTPATH=${AQTPATH}" >> $GITHUB_ENV | ||
echo "DEPSPATH=${DEPSPATH}" >> $GITHUB_ENV | ||
- name: Prepare macOS temp disk | ||
if: ${{runner.os == 'macOS'}} | ||
run: | | ||
export TEMP_DMGFILE=${HOME}/temp.dmg | ||
hdiutil create -size 700m -fs HFS+ -volname "${PACKAGE_NAME}" "${TEMP_DMGFILE}" | ||
hdiutil attach "${TEMP_DMGFILE}" | ||
TEMP_DMGPOINT="/Volumes/${PACKAGE_NAME}" | ||
echo "TEMP_DMGNAME=\"${TEMP_DMGNAME}\"" >> $GITHUB_ENV | ||
echo "TEMP_DMGFILE=\"${TEMP_DMGFILE}\"" >> $GITHUB_ENV | ||
echo "TEMP_DMGPOINT=\"${TEMP_DMGPOINT}\"" >> $GITHUB_ENV | ||
ls -lah ${PWD} | ||
- name: Setup install prefix | ||
run: | | ||
if [ ${{ runner.os }} == "Linux" ]; then | ||
export INSTALL_PREFIX=${{env.WORKDIR}}/${{env.pkgname}}-appdir/usr | ||
elif [ ${{ runner.os }} == "macOS" ]; then | ||
export INSTALL_PREFIX="${{env.TEMP_DMGPOINT}}" | ||
else | ||
export INSTALL_PREFIX=${{env.WORKDIR}}/${{env.pkgname}}-appdir | ||
fi | ||
echo "INSTALL_PREFIX=$INSTALL_PREFIX" >> $GITHUB_ENV | ||
- name: Install AQT | ||
shell: 'bash' | ||
if: ${{matrix.aqt-os != 'none'}} | ||
run: | | ||
python3 -m pip install --break-system-packages --user aqtinstall | ||
- name: Install Qt (with AQT) | ||
shell: 'bash' | ||
if: ${{matrix.aqt-os != 'none'}} | ||
run: | | ||
AQT_INSTALL="python3 -m aqt install-qt -O ${{matrix.aqt-prefix}} ${{matrix.aqt-os}} desktop ${{matrix.qt-version}} ${{matrix.aqt-arch}}" | ||
QT6_MODULES=(qtconnectivity qtserialport qtcharts) | ||
QT5_MODULES=(qtcharts) | ||
${AQT_INSTALL} | ||
if [[ ${{matrix.qt-version}} == 6.* ]]; then | ||
for i in ${QT6_MODULES[@]}; do | ||
${AQT_INSTALL} -m $i | ||
done | ||
else | ||
for i in ${QT5_MODULES[@]}; do | ||
${AQT_INSTALL} -m $i | ||
done | ||
fi | ||
- name: Install QT (mingw) | ||
if: ${{matrix.aqt-os == 'none' && runner.os == 'Windows'}} | ||
run: | | ||
QTVER=${{matrix.qt-version}} | ||
QTVER=${QTVER:0:1} | ||
pacman -S --noconfirm \ | ||
${MINGW_PACKAGE_PREFIX}-qt${QTVER}-connectivity \ | ||
${MINGW_PACKAGE_PREFIX}-qt${QTVER}-serialport \ | ||
${MINGW_PACKAGE_PREFIX}-qt${QTVER}-charts | ||
- name: Install QT (linux) | ||
if: ${{matrix.aqt-os == 'none' && runner.os == 'Linux'}} | ||
run: | | ||
QTVER=${{matrix.qt-version}} | ||
QTVER=${QTVER:0:1} | ||
if [[ ${{matrix.qt-version}} == 6.* ]]; then | ||
sudo apt-get install -y qt6-base-dev \ | ||
qt6-base-dev-tools \ | ||
qt6-serialport-dev \ | ||
qt6-charts-dev \ | ||
qt6-connectivity-dev \ | ||
qt6-tools-dev \ | ||
qt6-tools-dev-tools \ | ||
qmake6 | ||
else | ||
sudo apt-get install -y qtbase5-dev \ | ||
libqt5charts5-dev \ | ||
libqt5serialport5-dev \ | ||
qtconnectivity5-dev \ | ||
qt5-qmake | ||
fi | ||
- name: FETCH FFTW3 | ||
if: ${{matrix.build-fftw}} | ||
run: | | ||
wget https://www.fftw.org/fftw-3.3.10.tar.gz | ||
tar -vxzf fftw-3.3.10.tar.gz | ||
export FFTW_BUILD_DIR=${{env.WORKDIR}}/fftw-build | ||
if [ ${{ runner.os }} == "Windows" ]; then | ||
echo "FFTW_BUILD_DIR=$(cygpath -m "${FFTW_BUILD_DIR}")" >> $GITHUB_ENV | ||
else | ||
echo "FFTW_BUILD_DIR="${FFTW_BUILD_DIR}"" >> $GITHUB_ENV | ||
fi | ||
- name: Compile FFTW3 (WINDOWS) | ||
if: ${{( matrix.name == 'windows-qt6-msvc' || matrix.name == 'windows-qt5-msvc' ) && matrix.build-fftw}} | ||
shell: pwsh | ||
run: | | ||
cmake -S fftw-3.3.10 -B ${{env.WORKDIR}}/fftw-build ${{matrix.flags}} -DCMAKE_INSTALL_PREFIX=${{env.DEPSPATH}} | ||
cmake --build ${{env.FFTW_BUILD_DIR}} --config Release | ||
- name: Compile FFTW3 (POSIX) | ||
if: ${{( matrix.name != 'windows-qt6-msvc' || matrix.name != 'windows-qt5-msvc' ) && matrix.build-fftw}} | ||
run: | | ||
cmake -S fftw-3.3.10 -B ${{env.WORKDIR}}/fftw-build ${{matrix.flags}} -DCMAKE_INSTALL_PREFIX=${{env.DEPSPATH}} | ||
cmake --build ${{env.FFTW_BUILD_DIR}} | ||
- name: Install FFTW3 | ||
if: ${{matrix.build-fftw}} | ||
run: cmake --install ${{env.FFTW_BUILD_DIR}} | ||
- name: Install FFTW3 (MinGW) | ||
if: ${{!(matrix.build-fftw) && (runner.os == 'Windows')}} | ||
shell: 'msys2 {0}' | ||
run: | | ||
pacman -S --noconfirm \ | ||
${MINGW_PACKAGE_PREFIX}-fftw | ||
- name: Install FFTW3 (Linux) | ||
if: ${{!(matrix.build-fftw) && (runner.os == 'Linux')}} | ||
run: | | ||
sudo apt-get install -y libfftw3-dev | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: 'true' | ||
- name: Run Configure | ||
run: | | ||
cmake -S "${{env.WORKDIR}}" \ | ||
-B "${{env.WORKDIR}}/build" ${{matrix.flags}} \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX="${{env.INSTALL_PREFIX}}" \ | ||
-DCMAKE_PREFIX_PATH="${{env.AQTPATH}}/${{matrix.qt-version}}/${{matrix.aqt-subdir}};${{env.DEPSPATH}}" | ||
- name: Compile Code (POSIX) | ||
if: ${{matrix.name != 'windows-qt6-msvc'}} | ||
run: cmake --build ${{env.WORKDIR}}/build | ||
- name: Compile Code (WINDOWS) | ||
if: ${{matrix.name == 'windows-qt6-msvc'}} | ||
shell: pwsh | ||
run: cmake --build ${{github.workspace}}/build --config Release | ||
- name: Prepare appdir | ||
run: | | ||
if [ ${{ runner.os }} == "Windows" ]; then export SUFFIX="${{env.pkgname}}" | ||
elif [ ${{ runner.os }} == "macOS" ]; then export SUFFIX="${{env.pkgname}}.app" | ||
else export SUFFIX="" | ||
fi | ||
export APPDIR="${{env.INSTALL_PREFIX}}/${SUFFIX}" | ||
echo "APPDIR=${APPDIR}" >> $GITHUB_ENV | ||
- name: Install | ||
run: | | ||
cmake --install ${{env.WORKDIR}}/build --prefix "${{ env.INSTALL_PREFIX }}" | ||
- name: Create MacOS Package | ||
if: ${{runner.os == 'macOS'}} | ||
run: | | ||
DESTINATION_DIR=${{env.PACKAGE_NAME}} | ||
DIST_DMG=${{env.PACKAGE_NAME}}.dmg | ||
mkdir ${DESTINATION_DIR} || echo "::warning:: ${DESTINATION_DIR} already exists" | ||
${{matrix.aqt-prefix}}/${{matrix.qt-version}}/${{matrix.aqt-subdir}}/bin/macdeployqt \ | ||
"${{env.APPDIR}}" | ||
find ${{env.DEPSPATH}} -name "*.dylib" -exec cp {} "${{env.APPDIR}}"/Contents/Frameworks \; | ||
codesign --verbose --strict --continue --timestamp --force --deep -s ${IDENTITY_NAME} "${{env.APPDIR}}" | ||
ln -s /Applications/ "${{ env.TEMP_DMGPOINT }}"/Applications | ||
hdiutil detach "${{ env.TEMP_DMGPOINT }}" | ||
hdiutil convert ${{ env.TEMP_DMGFILE }} -format UDBZ \ | ||
-o ${DESTINATION_DIR}/${DIST_DMG} | ||
shasum -a 256 ${DESTINATION_DIR}/${DIST_DMG} | ||
- name: Create Windows Package | ||
if: ${{runner.os == 'Windows'}} | ||
run: | | ||
export ARTIFACT_DIR=${{env.WORKDIR}}/${PACKAGE_NAME} | ||
find "${{env.DEPSPATH}}" -name "*.dll" -exec cp {} ${{env.APPDIR}}/ \; | ||
if [[ ${{matrix.aqt-os }} == 'none' ]]; then | ||
windeployqt --release ${{env.APPDIR}}/ || echo "::warning::Unknown error" | ||
else | ||
${{matrix.aqt-prefix}}/${{matrix.qt-version}}/${{matrix.aqt-subdir}}/bin/windeployqt.exe --release ${{env.APPDIR}}/ | ||
fi | ||
if [[ ${{matrix.aqt-os }} == 'none' ]]; then | ||
echo "::notice:: Deploying additional libs" | ||
for i in $(ldd ${{env.APPDIR}}/${{env.pkgname}} | cut -f 3 -d " " | grep "/bin/") | ||
do cp -v $i ${{env.APPDIR}}/ | ||
done | ||
fi | ||
mkdir $ARTIFACT_DIR || echo "::warning::${ARTIFACT_DIR} already exists" | ||
cd $ARTIFACT_DIR | ||
cpack --config ${{env.WORKDIR}}/build/CPackConfig.cmake -G NSIS -V | ||
mv ${{env.pkgname}}*.exe ${PACKAGE_NAME}-Installer.exe | ||
cpack --config ${{env.WORKDIR}}/build/CPackConfig.cmake -G 7Z | ||
mv ${{env.pkgname}}*.7z ${PACKAGE_NAME}-Portable.7z | ||
rm -Rf _CPack_Packages/ | ||
- name: Create AppImage | ||
if: ${{runner.os == 'Linux'}} | ||
run: | | ||
if [[ ${{matrix.aqt-os}} == "linux" ]]; then | ||
sudo bash -c "echo ${{matrix.aqt-prefix}}/${{matrix.qt-version}}/${{matrix.aqt-subdir}}/lib > /etc/ld.so.conf.d/aqt.conf" | ||
sudo bash -c "echo ${{matrix.deps-prefix}}/lib > /etc/ld.so.conf.d/deps.conf" | ||
sudo rm /etc/ld.so.cache | ||
sudo ldconfig | ||
fi | ||
echo "::group:: Downloading linux deploy" | ||
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | ||
wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage | ||
wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage | ||
echo "::endgroup::" | ||
LINUXDEPLOY=linuxdeploy-x86_64.AppImage | ||
chmod +x *.AppImage | ||
APPDIR=${{env.pkgname}}.AppDir | ||
ICONFILE=$(find ${{ env.APPDIR }} -name *.png) | ||
DESKTOPFILE=$(find ${{env.APPDIR}} -name *.desktop) | ||
EXECFILE=$(find ${{env.APPDIR}} -name ${{env.pkgname}} -type f -executable) | ||
if [[ ${{matrix.aqt-os}} == "linux" ]]; then | ||
export QTDIR=${{matrix.aqt-prefix}}/${{matrix.qt-version}}/${{matrix.aqt-subdir}} | ||
export QMAKE=${QTDIR}/bin/qmake | ||
export QT_INSTALL_PLUGINS=${QTDIR}/plugins/ | ||
fi | ||
echo "::group:: Linux deploy QT" | ||
./${LINUXDEPLOY} \ | ||
--appdir=${APPDIR} \ | ||
--executable=${EXECFILE} \ | ||
--icon-file=${ICONFILE} \ | ||
--desktop-file=${DESKTOPFILE} \ | ||
--plugin qt | ||
echo "::endgroup::" | ||
echo "::group:: Creating AppImage" | ||
./${LINUXDEPLOY} --appdir=${APPDIR} --output=appimage | ||
mv ${{env.pkgname}}*.AppImage ${{env.pkgname}}-${{matrix.name}}.AppImage | ||
export APPIMAGEDIR=${{github.workspace}}/${{env.pkgname}}-${{matrix.name}} | ||
mkdir $APPIMAGEDIR || echo "::warning::${APPIMAGEDIR} already exists" | ||
cp ${{env.pkgname}}-${{matrix.name}}.AppImage ${{env.pkgname}}-${{matrix.name}} | ||
echo "::endgroup::" | ||
# - name: Setup tmate session | ||
# uses: mxschmitt/action-tmate@v3 | ||
# if: ${{ failure() }} | ||
# with: | ||
# limit-access-to-actor: true | ||
# #install-dependencies: false | ||
# timeout-minutes: 60 | ||
- name: Upload All Binaries | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{env.pkgname}}-${{matrix.name}} | ||
path: ${{github.workspace}}/${{env.pkgname}}-${{matrix.name}} | ||
publish: | ||
needs: build | ||
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Get Build Tag | ||
id: get_tag | ||
run: | | ||
DATE=$(date +'%Y%m%d-%H%M') | ||
BUILD_TAG="${{env.pkgname}}-snapshot-${DATE}" | ||
echo "BUILD_TAG=${BUILD_TAG}" >> $GITHUB_OUTPUT | ||
echo DATE=$DATE >> $GITHUB_ENV | ||
- name: Get macOS universal binary | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{env.pkgname}}-macos-qt6-universal | ||
path: ${{github.workspace}}/${{env.pkgname}}-macos-qt6-universal | ||
- name: Get macOS legacy binary | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{env.pkgname}}-macos-qt5-legacy | ||
path: ${{github.workspace}}/${{env.pkgname}}-macos-qt5-legacy | ||
- name: Get Linux binary (QT6) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{env.pkgname}}-linux-qt6 | ||
path: ${{github.workspace}}/${{env.pkgname}}-linux-qt6 | ||
- name: Get Linux binary (QT5) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{env.pkgname}}-linux-qt5 | ||
path: ${{github.workspace}}/${{env.pkgname}}-linux-qt5 | ||
- name: Get Windows binary (Qt6 MSVC) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{env.pkgname}}-windows-qt6-msvc | ||
path: ${{github.workspace}}/${{env.pkgname}}-windows-qt6-msvc | ||
- name: Get Windows binary (Qt5 MSVC) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{env.pkgname}}-windows-qt5-msvc | ||
path: ${{github.workspace}}/${{env.pkgname}}-windows-qt5-msvc | ||
- name: Get Windows binary (Qt6 MINGW) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{env.pkgname}}-windows-qt6-mingw | ||
path: ${{github.workspace}}/${{env.pkgname}}-windows-qt6-mingw | ||
- name: Get Windows (Qt5 MinGW) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{env.pkgname}}-windows-qt5-mingw | ||
path: ${{github.workspace}}/${{env.pkgname}}-windows-qt5-mingw | ||
- if: github.event_name == 'push' # this is a snapshot build. create a release and upload binaries | ||
name: Create Snapshot Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: ${{ steps.get_tag.outputs.BUILD_TAG }} | ||
tag_name: ${{ steps.get_tag.outputs.BUILD_TAG }} | ||
generate_release_notes: true | ||
prerelease: true | ||
files: | | ||
${{github.workspace}}/${{env.pkgname}}-macos-qt6-universal/* | ||
${{github.workspace}}/${{env.pkgname}}-macos-qt5-legacy/* | ||
${{github.workspace}}/${{env.pkgname}}-linux-qt6/* | ||
${{github.workspace}}/${{env.pkgname}}-linux-qt5/* | ||
${{github.workspace}}/${{env.pkgname}}-windows-qt6-mingw/* | ||
${{github.workspace}}/${{env.pkgname}}-windows-qt5-mingw/* | ||
${{github.workspace}}/${{env.pkgname}}-windows-qt6-msvc/* | ||
${{github.workspace}}/${{env.pkgname}}-windows-qt5-msvc/* | ||
- if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v') # this is a versioned build. check if release already exists | ||
name: Find Existing Release | ||
id: find_release | ||
uses: cardinalby/git-get-release-action@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
doNotFailIfNotFound: true | ||
tag: ${{ github.ref_name }} | ||
- if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v') && steps.find_release.outputs.id != 0 # otherwise release does not exist, create one and upload binaries | ||
name: Create Tagged Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: ${{ github.ref_name }} | ||
tag_name: ${{ github.ref_name }} | ||
generate_release_notes: true | ||
prerelease: false | ||
files: | | ||
${{github.workspace}}/${{env.pkgname}}-macos-qt6-universal/* | ||
${{github.workspace}}/${{env.pkgname}}-macos-qt5-legacy/* | ||
${{github.workspace}}/${{env.pkgname}}-linux-qt6/* | ||
${{github.workspace}}/${{env.pkgname}}-linux-qt5/* | ||
${{github.workspace}}/${{env.pkgname}}-windows-qt6-mingw/* | ||
${{github.workspace}}/${{env.pkgname}}-windows-qt5-mingw/* | ||
${{github.workspace}}/${{env.pkgname}}-windows-qt6-msvc/* | ||
${{github.workspace}}/${{env.pkgname}}-windows-qt5-msvc/* |