Skip to content

Use saveFile() overload which takes QByteArray #12

Use saveFile() overload which takes QByteArray

Use saveFile() overload which takes QByteArray #12

Workflow file for this run

name: Build Packages
on:
push:
paths-ignore:
- 'doc/**'
- '**.md'
- 'appveyor.yml'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
- 'appveyor.yml'
env:
QT_VERSION: 5.15.2
QTCREATOR_VERSION: 4.15.2
SENTRY_VERSION: 0.4.11
SLATE_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
SLATE_SNAPSHOT: ${{ !startsWith(github.ref, 'refs/tags/v') }}
jobs:
version:
name: Determine Slate version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
release: ${{ steps.get-version.outputs.release }}
steps:
- name: Get version
id: get-version
run: |
if [[ "$SLATE_RELEASE" == 'true' ]]; then echo "::set-output name=version::${GITHUB_REF:11}" ; fi
if [[ "$SLATE_RELEASE" != 'true' ]]; then echo "::set-output name=version::$(date "+%Y.%m.%d")" ; fi
echo "::set-output name=release::${SLATE_RELEASE}"
linux:
name: Linux
runs-on: ubuntu-18.04
needs: version
env:
SLATE_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt update
sudo apt install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libzstd-dev libcurl4-openssl-dev qbs
- name: Install Qt
run: |
# Workaround for https://github.com/actions/runner/issues/1212
set -o pipefail
./dist/install-qt.sh --version ${QT_VERSION} qtbase qtdeclarative qtimageformats qtgraphicaleffects qtquickcontrols2 qttools icu | tee -a $GITHUB_PATH
./dist/install-qt.sh --version ${QTCREATOR_VERSION} qtcreator | tee -a $GITHUB_PATH
- name: Setup CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.19'
- name: Setup Qbs
run: |
qbs --version
qbs setup-toolchains --detect
qbs config defaultProfile x86_64-linux-gnu-gcc-9
echo "qbs profiles:"
qbs config --list profiles
echo "---"
- name: Build Slate
run: |
qbs install --install-root Slate config:release qbs.installPrefix:/usr qbs.debugInformation:true modules.cpp.separateDebugInformation:true
- name: Test Slate
run: |
DISPLAY=:1 qbs run -p test-app config:release -- -platform offscreen
- name: Deploy Slate
run: |
set -o pipefail
cp LICENSE.GPL3 *md Slate/
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -O linuxdeployqt
chmod a+x linuxdeployqt
./linuxdeployqt ./Slate/usr/share/applications/Slate.desktop -unsupported-allow-new-glibc -bundle-non-qt-libs -verbose=2
- name: Upload Slate
uses: actions/upload-artifact@v2
with:
name: Slate
path: Slate
# TODO: getting: "ERROR: Could not determine the path to the executable based on the desktop file" from this
# - name: Build AppImage
# run: |
# set -o pipefail
# cp LICENSE.GPL3 *md Slate/
# wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -O linuxdeployqt
# chmod a+x linuxdeployqt
# ./linuxdeployqt ./Slate/usr/share/applications/Slate.desktop -bundle-non-qt-libs -verbose=2
# ./linuxdeployqt --appimage-extract
# export PATH=$(readlink -f ./squashfs-root/usr/bin/):$PATH
# ./squashfs-root/usr/bin/appimagetool Slate/
# find ./Slate -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
# - name: Upload Slate.AppImage
# uses: actions/upload-artifact@v2
# with:
# name: Slate-x86_64.AppImage
# path: Slate-x86_64.AppImage
macos:
name: macOS
runs-on: macos-latest
needs: version
env:
SLATE_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Qt
run: |
set -o pipefail
sudo ./dist/install-qt.sh --version ${QT_VERSION} qtbase qtdeclarative qtimageformats qtgraphicaleffects qtquickcontrols2 qttools | tee -a $GITHUB_PATH
sudo ./dist/install-qt.sh --version ${QTCREATOR_VERSION} qtcreator | tee -a $GITHUB_PATH
- name: Setup Qbs
run: |
qbs setup-toolchains --detect
qbs config defaultProfile xcode
- name: Build Slate
run: |
qbs install --install-root install config:release qbs.installPrefix:""
- name: Package
run: |
macdeployqt install/Slate.app -verbose=2
pushd install
ruby ../dist/macos/fixup-install-names.rb
ditto -c -k --sequesterRsrc --keepParent Slate.app ../Slate-macos.zip
popd
- name: Upload Slate.app
uses: actions/upload-artifact@v2
with:
name: Slate-macos.app
path: Slate-macos.zip
windows:
name: Windows (${{ matrix.arch }}-bit)
runs-on: windows-latest
needs: version
strategy:
matrix:
include:
- arch: 32
openssl_arch: x86
- arch: 64
openssl_arch: x64
env:
SLATE_VERSION: ${{ needs.version.outputs.version }}
QT_TOOLCHAIN: win${{ matrix.arch }}_mingw81
MINGW_VERSION: 8.1.0
MINGW_COMPONENT: win${{ matrix.arch }}_mingw810
OPENSSL_VERSION: 1.1.1
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Qt
run: |
echo "QT_PATH=$(./dist/install-qt.sh --version ${QT_VERSION} --toolchain ${QT_TOOLCHAIN} qtbase qtdeclarative qtimageformats qtgraphicaleffects qtquickcontrols2 qttools qttranslations)" >> $GITHUB_ENV
echo "MINGW_PATH=$(./dist/install-qt.sh --version ${MINGW_VERSION} ${MINGW_COMPONENT})" >> $GITHUB_ENV
echo "OPENSSL_PATH=$(./dist/install-qt.sh --version ${OPENSSL_VERSION} openssl --arch ${{ matrix.openssl_arch }})" >> $GITHUB_ENV
./dist/install-qt.sh --version ${QTCREATOR_VERSION} qtcreator >> $GITHUB_PATH
- name: Setup Qbs
run: |
qbs setup-toolchains ${MINGW_PATH}/*-w64-mingw32-gcc.exe mingw
qbs setup-qt ${QT_PATH}/qmake.exe qt
qbs config defaultProfile qt
- name: Build Slate
run: |
export TILED_MSI_VERSION=1.4.${GITHUB_RUN_NUMBER}
qbs build config:release
#TODO: need to do zip up the build dir and upload it below
#mv release/installer*/Slate-*.msi .
- name: Upload Slate installer
uses: actions/upload-artifact@v2
with:
name: Slate-win${{ matrix.arch }}.msi
path: Slate-*.msi
- name: Upload Slate archive
uses: actions/upload-artifact@v2
with:
name: Slate-win${{ matrix.arch }}
path: release/install-root/*
# itch:
# name: Upload to itch.io (${{ matrix.channel }})
# runs-on: ubuntu-latest
# needs: [version, linux, macos, windows]
# if: github.repository == 'mitchcurtis/slate' && github.event_name == 'push' && github.ref == 'refs/heads/snapshot'
# strategy:
# matrix:
# include:
# - channel: linux-64bit
# artifact: Slate-x86_64.AppImage
# prepare: chmod +x upload/Slate-x86_64.AppImage
# - channel: macos
# artifact: Slate-macos.app
# prepare: |
# pushd upload
# unzip Slate-macos.zip
# rm Slate-macos.zip
# popd
# - channel: windows-32bit
# artifact: Slate-win32
# - channel: windows-64bit
# artifact: Slate-win64
# steps:
# - name: Download artifact
# id: download
# uses: actions/download-artifact@v2
# with:
# name: ${{ matrix.artifact }}
# path: upload
# - name: Prepare artifact
# if: matrix.prepare
# run: ${{ matrix.prepare }}
# - name: Download Butler
# run: |
# curl -JOL https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
# unzip butler-linux-amd64.zip
# - name: Push to itch.io
# env:
# BUTLER_API_KEY: ${{ secrets.BUTLER_CREDENTIALS }}
# SLATE_VERSION: ${{ needs.version.outputs.version }}
# run: |
# ITCH_CHANNEL=${{ matrix.channel }}
# if [[ "$SLATE_SNAPSHOT" == 'true' ]]; then ITCH_CHANNEL="${ITCH_CHANNEL}-snapshot" ; fi
# ./butler push --userversion=${SLATE_VERSION} upload mitchcurtis/slate:${ITCH_CHANNEL}
# github:
# name: Upload to GitHub releases
# runs-on: ubuntu-latest
# needs: [version, linux, macos, windows]
# if: github.repository == 'mitchcurtis/slate' && github.event_name == 'push' && needs.version.outputs.release == 'true'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# steps:
# - name: Create release
# id: create_release
# uses: actions/create-release@v1
# with:
# tag_name: ${{ github.ref }}
# release_name: Slate ${{ needs.version.outputs.version }}
# draft: true
# prerelease: false
#TODO: zips instead of msi
# - name: Download Windows 64-bit installer
# id: download-win64-installer
# uses: actions/download-artifact@v2
# with:
# name: Slate-win64.msi
# - name: Download Windows 32-bit installer
# id: download-win32-installer
# uses: actions/download-artifact@v2
# with:
# name: Slate-win32.msi
# - name: Download Linux AppImage
# id: download-appimage
# uses: actions/download-artifact@v2
# with:
# name: Slate-x86_64.AppImage
# - name: Download macOS app
# id: download-app
# uses: actions/download-artifact@v2
# with:
# name: Slate-macos.app
#TODO
# - name: Upload Windows 64-bit installer
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Slate-${{ needs.version.outputs.version }}-win64.msi
# asset_name: Slate-${{ needs.version.outputs.version }}-win64.msi
# asset_content_type: applictaion/x-msi
# - name: Upload Windows 32-bit installer
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Slate-${{ needs.version.outputs.version }}-win32.msi
# asset_name: Slate-${{ needs.version.outputs.version }}-win32.msi
# asset_content_type: applictaion/x-msi
# - name: Upload Linux AppImage
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Slate-x86_64.AppImage
# asset_name: Slate-${{ needs.version.outputs.version }}-x86_64.AppImage
# asset_content_type: application/vnd.appimage
# - name: Upload macOS app
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Slate-macos.zip
# asset_name: Slate-${{ needs.version.outputs.version }}-macos.zip
# asset_content_type: application/zip
# - name: Checkout repository
# uses: actions/checkout@v2