mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
97 lines
3.8 KiB
YAML
97 lines
3.8 KiB
YAML
# aka.ms/yaml
|
|
# TODO: reuse steps
|
|
trigger:
|
|
- master
|
|
- develop
|
|
|
|
jobs:
|
|
- job: Linux
|
|
pool:
|
|
vmImage: 'ubuntu-16.04'
|
|
steps:
|
|
- template: azure-pipelines-build-number.yml
|
|
- script: |
|
|
sudo add-apt-repository 'deb http://download.opensuse.org/repositories/home:/selmf/xUbuntu_16.04/ /'
|
|
sudo add-apt-repository ppa:kubuntu-ppa/backports
|
|
sudo apt-get update
|
|
sudo apt-get install -y --allow-unauthenticated qt-default qt5-qmake \
|
|
qtbase5-dev qtmultimedia5-dev libpoppler-qt5-dev qtscript5-dev \
|
|
libqt5opengl5-dev libglu1-mesa-dev libunarr-dev qtdeclarative5-dev
|
|
displayName: 'Install dependencies'
|
|
- script: |
|
|
export DEFINES_VAR=DEFINES+\=\"BUILD_NUMBER=\\\\\\\"$(Build.BuildNumber)\\\\\\\"\"
|
|
qmake CONFIG+="unarr" $DEFINES_VAR
|
|
make
|
|
displayName: 'Build'
|
|
- job: MacOS
|
|
pool:
|
|
vmImage: 'macOS-10.14'
|
|
steps:
|
|
- template: azure-pipelines-build-number.yml
|
|
- script: |
|
|
brew install qt
|
|
brew link qt --force
|
|
brew install create-dmg
|
|
brew install clang-format
|
|
wget "https://sourceforge.net/projects/p7zip/files/p7zip/16.02/p7zip_16.02_src_all.tar.bz2" -P $(Build.SourcesDirectory)/compressed_archive
|
|
tar xjf $(Build.SourcesDirectory)/compressed_archive/p7zip_16.02_src_all.tar.bz2 -C $(Build.SourcesDirectory)/compressed_archive
|
|
mv $(Build.SourcesDirectory)/compressed_archive/p7zip_16.02 $(Build.SourcesDirectory)/compressed_archive/libp7zip
|
|
displayName: 'Install dependencies'
|
|
- script: |
|
|
cd $(Build.SourcesDirectory)
|
|
find . \( -name '*.h' -or -name '*.cpp' -or -name '*.c' -or -name '*.mm' -or -name '*.m' \) -print0 | xargs -0 clang-format -style=file -i
|
|
if [ "$(git diff $(Build.SourceVersion))" != "" ]; then exit 1; fi
|
|
displayName: 'Check format'
|
|
- script: |
|
|
cd $(Build.SourcesDirectory)
|
|
VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )"
|
|
./compileOSX.sh $VERSION
|
|
displayName: 'Build'
|
|
- task: CopyFiles@2
|
|
inputs:
|
|
contents: '*.dmg'
|
|
targetFolder: $(Build.ArtifactStagingDirectory)
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
pathToPublish: $(Build.ArtifactStagingDirectory)
|
|
artifactName: Macos dmg
|
|
- job: Windows
|
|
pool:
|
|
vmImage: 'vs2017-win2016'
|
|
steps:
|
|
- template: azure-pipelines-build-number.yml
|
|
- script: |
|
|
pip install aqtinstall
|
|
mkdir C:\Qt
|
|
python -m aqt install -O c:\Qt 5.12.4 windows desktop win64_msvc2017_64
|
|
choco install -y wget
|
|
choco install innosetup
|
|
wget "https://sourceforge.net/projects/sevenzip/files/7-Zip/18.05/7z1805-src.7z" -P $(Build.SourcesDirectory)\compressed_archive
|
|
7z x $(Build.SourcesDirectory)\compressed_archive\7z1805-src.7z -o$(Build.SourcesDirectory)\compressed_archive\lib7zip
|
|
wget "https://go.microsoft.com/fwlink/?LinkId=746572" -O $(Build.SourcesDirectory)\vc_redist.x64.exe
|
|
# 32bit https://go.microsoft.com/fwlink/?LinkId=746571
|
|
displayName: 'Install dependencies'
|
|
- script: |
|
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
|
set PATH=%PATH%;C:\Qt\Qt5.12.4\5.12.4\msvc2017_64\bin
|
|
set DEFINES_VAR=DEFINES+="BUILD_NUMBER=\\\\\\\"$(Build.BuildNumber)\\\\\\\""
|
|
qmake CONFIG+="7zip" %DEFINES_VAR%
|
|
nmake
|
|
displayName: 'Build'
|
|
- script: |
|
|
set PATH=%PATH%;C:\Qt\Qt5.12.4\5.12.4\msvc2017_64\bin
|
|
cd $(Build.SourcesDirectory)\ci\win
|
|
.\create_installer.cmd x64 7z $(buildNumber)
|
|
displayName: 'Create installer'
|
|
- task: CopyFiles@2
|
|
inputs:
|
|
contents: $(Build.SourcesDirectory)\ci\win\Output\*.exe
|
|
targetFolder: $(Build.ArtifactStagingDirectory)
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
pathToPublish: $(Build.ArtifactStagingDirectory)
|
|
artifactName: Windows 64 7z Installer
|
|
|
|
|
|
|