atrooney-online-2/.gitlab-ci.yml
scatterflower 9eb0f53db1
Reset BASS when switching devices; drop Qt Multimedia support (#262)
* Allow changing audio device on the fly while in a server
* Use default audio device if device in config doesn't exist
* Automatically change audio device to default when current one is invalid
* Destroy Qt Multimedia support

It was decided that there was not enough attention being given to Qt
Multimedia support to justify its continued maintenance simply as a
libre alternative to BASS. While substantial changes to audio were being
made in 2.8, the Qt Multimedia support code fell behind in disrepair.
It's clear that there is no vested interest in implementing audio
features twice for the sake of licensing.

When it's time to switch to another audio library, it will be done
unilaterally.

* CI: Use BASS for Linux build

Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
2020-08-19 16:40:37 -05:00

243 lines
5.7 KiB
YAML

stages:
- build
- deploy
- publish
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- lib/
variables:
DEBIAN_FRONTEND: noninteractive
before_script:
- echo Current working directory is $(pwd)
build linux x86_64:
image: ubuntu
stage: build
tags:
- docker
- linux
script:
# Install dependencies
- apt-get update
- >
apt-get install --no-install-recommends -y qt5-default qtmultimedia5-dev
clang make git sudo curl ca-certificates pkg-config upx unzip xz-utils
- git submodule init
- git submodule update
# Print versions
- qmake --version
- clang --version
# Extract BASS
- mkdir bass
- cd bass
- curl http://www.un4seen.com/files/bass24-linux.zip -o bass.zip
- unzip bass.zip
- cp x64/libbass.so ../lib
- curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus.zip
- unzip bassopus.zip
- cp x64/libbassopus.so ../lib
- cd ..
# Extract Discord RPC
- mkdir discord-rpc
- cd discord-rpc
- curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-linux.zip -o discord_rpc_linux.zip
- unzip discord_rpc_linux.zip
- cp discord-rpc/linux-dynamic/lib/libdiscord-rpc.so ../lib
- cd ..
# Extract QtApng
- mkdir qtapng
- cd qtapng
- curl -L https://github.com/Skycoder42/QtApng/releases/download/1.1.0-5/build_gcc_64_5.12.0.tar.xz -o apng.tar.xz
- tar -xvf apng.tar.xz
- cp gcc_64/plugins/imageformats/libqapng.so ../lib
- cd ..
# Build
- qmake -spec linux-clang "DEFINES += DISCORD"
- make -j4
# Post-processing
- upx --lzma -9 --force bin/Attorney_Online
artifacts:
paths:
- bin/
build windows i686:
image: ${CI_REGISTRY_IMAGE}/builder-windows-i686
stage: build
tags:
- docker
- linux
script:
# Install dependencies
- apt-get update
- apt-get install --no-install-recommends -y make curl ca-certificates upx unzip
- git submodule init
- git submodule update
# Print versions
- /opt/mxe/usr/${TARGET_SPEC}/qt5/bin/qmake --version
# Extract BASS
- mkdir bass
- cd bass
- curl http://www.un4seen.com/files/bass24.zip -o bass.zip
- unzip bass.zip
- cp bass.dll ../lib
- curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip
- unzip bassopus.zip
- cp bassopus.dll ../lib
- cd ..
# Extract QtApng
# - mkdir qtapng
# - cd qtapng
# - curl -L https://github.com/Skycoder42/QtApng/releases/download/1.1.2-2/qtapng_mingw73_32_5.13.0.zip -o apng.zip
# - unzip apng.zip
# - mkdir ../lib/imageformats
# - cp mingw73_32/plugins/imageformats/qapng.dll ../lib/imageformats/
# - cd ..
- ls lib
# Build
- /opt/mxe/usr/${TARGET_SPEC}/qt5/bin/qmake "DEFINES += DISCORD"
- make -j4
# Post-processing
- upx --lzma -9 --force bin/Attorney_Online.exe
artifacts:
paths:
- bin/
# Base folder
.deploy_base: &deploy_base |
mkdir base
cp -a ../base/ base/
# Miscellaneous files
.deploy_misc: &deploy_misc |
cp -a ../README.md README.md.txt
cp -a ../LICENSE.MIT LICENSE.txt
deploy linux x86_64:
stage: deploy
dependencies:
- build linux x86_64
tags:
- docker
- linux
script:
- mkdir artifact
- cd artifact
- *deploy_base
- *deploy_misc
# Platform-specific
- cp -a ../lib/* .
- cp -a ../bin/Attorney_Online .
- echo "#!/bin/sh" >> ./run.sh
- echo "LD_LIBRARY_PATH=.:\$LD_LIBRARY_PATH ./Attorney_Online" >> ./run.sh
- chmod +x ./run.sh
# Zipping
# zip -r -9 -l Attorney_Online_$(git describe --tags)_linux_x86_64.zip .
- mkdir ../zip
- tar cavf ../zip/Attorney_Online_$(git describe --tags)_linux_x64.tar.xz *
- sha1sum ../zip/*
artifacts:
paths:
- zip/
deploy windows i686:
image: ubuntu
stage: deploy
dependencies:
- build windows i686
tags:
- docker
- linux
script:
- apt-get update
- apt-get install --no-install-recommends -y zip git
- mkdir artifact
- cd artifact
- *deploy_base
- *deploy_misc
# Platform-specific
- cp -a ../lib/*.dll .
- mkdir imageformats
- 'cp -a ../lib/imageformats/*.dll imageformats/ || :'
- cp -a ../bin/Attorney_Online.exe .
# Zipping
# -r: recursive; -9: max compression; -l: convert to CR LF
- mkdir ../zip
- zip -r -9 -l ../zip/Attorney_Online_$(git describe --tags)_windows_x86.zip .
- sha1sum ../zip/*
artifacts:
paths:
- zip/
# How to publish to S3/Wasabi:
# - Ensure the following variables have been populated in the CI/CD settings:
# - S3_ACCESS_KEY, S3_SECRET_KEY
# - S3_MANIFESTS, S3_ARCHIVES
# - Select "Run Pipeline" on the Pipelines menu on GitLab.
# - Select the version you want to release.
# - Set the following variables:
# - MANIFEST: program_winnt_i386.json
# - ARCHIVE_FULL: ao-X.Y.Z-win32.zip
# - VERSION: X.Y.Z
# - EXECUTABLE: Attorney_Online_X.Y.Z.exe
# - Run the pipeline to completion.
# (See scripts/wasabi.sh)
publish linux x86_64:
image: ubuntu
stage: publish
dependencies:
- deploy linux x86_64
when: manual
script:
- apt-get update
- apt-get install --no-install-recommends -y git nodejs npm awscli
- cd scripts
- npm install
- cd ..
- cd zip
- ../scripts/wasabi_program.sh
variables:
MANIFEST: program_linux_x86_64.json
ARTIFACT_SUFFIX: linux_x64.tar.xz
publish windows i686:
image: ubuntu
stage: publish
dependencies:
- deploy windows i686
when: manual
script:
- apt-get update
- apt-get install --no-install-recommends -y git nodejs npm awscli
- cd scripts
- npm install
- cd ..
- cd zip
- ../scripts/wasabi_program.sh
variables:
MANIFEST: program_winnt_i386.json
ARTIFACT_SUFFIX: windows_x86.zip