Add --version:copy, deprecate --version:paste.
[NetHack.git] / azure-pipelines.yml
blobad29099c54884c47a9d0183c108a779ceaceca4d
1 strategy:
2   matrix:
3     linux_latest_gcc9_minimal:
4       imageName: 'ubuntu-latest'
5       toolchainName: gcc9
6       buildTargetName: minimal
7     linux_jammy_clang_all:
8       imageName: 'ubuntu-22.04'
9       toolchainName: clang
10       buildTargetName: all
11     linux_jammy_gcc9_all:
12       imageName: 'ubuntu-22.04'
13       toolchainName: gcc9
14       buildTargetName: all
15     linux_jammy_gcc12_all:
16       imageName: 'ubuntu-22.04'
17       toolchainName: gcc12
18       buildTargetName: all
19     macOS_latest_clang_all:
20       imageName: 'macOS-latest'
21       toolchainName: clang
22       buildTargetName: all
23     macOS_Ventura_clang13_all:
24       imageName: 'macOS-13'
25       toolchainName: clang
26       buildTargetName: all
27     windows-visualstudio:
28       imageName: 'windows-latest'
29       toolchainName: vs
30       buildTargetName: all
31     windows-mingw:
32       imageName: 'windows-2019'
33       toolchainName: mingw
34       buildTargetName: all
35     linux_focal_cross_msdos:
36       imageName: 'ubuntu-20.04'
37       toolchainName: cross
38       buildTargetName: msdos
39     linux_jammy_docs:
40       imageName: 'ubuntu-22.04'
41       toolchainName: docs
42       buildTargetName: all
43       continueOnError: true
45 pool:
46   vmImage: $(imageName)
48 # resources:
49 #  repositories:
50 #  - repository: pdcursesrepo
51 #    type: github
52 #    name: wmcbrine/PDCurses
53 #    ref: refs/heads/master
54 #    endpoint: github.com_barthouse
56 variables:
57   toolchain: $(toolchainName)
58   buildTarget: $(buildTargetName)
59   netHackPath: s/NetHack
61 steps:
62 - bash: |
63     if [ "$(toolchain)" == "gcc7" ]
64     then
65       echo "##vso[task.setvariable variable=CC]gcc-7"
66       echo "##vso[task.setvariable variable=CXX]g++-7"
67     fi
68     if [ "$(toolchain)" == "gcc9" ]
69     then
70       echo "##vso[task.setvariable variable=CC]gcc-9"
71       echo "##vso[task.setvariable variable=CXX]g++-9"
72     fi
73     if [ "$(toolchain)" == "gcc10" ]
74     then
75       echo "##vso[task.setvariable variable=CC]gcc-10"
76       echo "##vso[task.setvariable variable=CXX]g++-10"
77     fi
78     if [ "$(toolchain)" == "gcc11" ]
79     then
80       echo "##vso[task.setvariable variable=CC]gcc-11"
81       echo "##vso[task.setvariable variable=CXX]g++-11"
82     fi
83     if [ "$(toolchain)" == "gcc12" ]
84     then
85       echo "##vso[task.setvariable variable=CC]gcc-12"
86       echo "##vso[task.setvariable variable=CXX]g++-12"
87     fi
88     if [ "$(toolchain)" == "clang" ]
89     then
90       echo "##vso[task.setvariable variable=CC]clang"
91       echo "##vso[task.setvariable variable=CXX]clang++"
92     fi
93     if [ "$(toolchain)" == "cross" ]
94     then
95       echo "##vso[task.setvariable variable=CC]gcc-9"
96       echo "##vso[task.setvariable variable=CXX]g++-9"
97     fi
98   displayName: 'Setting variables'
100 - bash: |
101     echo "toolchain: $(toolchain)"
102     echo "buildTarget: $(buildTarget)"
103     echo "netHackPath: $NETHACKPATH"
104     echo "CC: $CC"
105     echo "CXX: $CXX"
106   displayName: 'Echoing variables'
108 - checkout: git://NetHack/NetHack@NetHack-3.7
109   submodules: true
110   path: $(netHackPath) # $(Agent.BuildDirectory)/$(netHackPath)
112 - task: DownloadSecureFile@1
113   name: storeKey
114   inputs:
115     secureFile: 'NetHackPackage_StoreKey.pfx'
116   condition: eq( variables.toolchain, 'vs' )
117   displayName: 'Store Key Download'
119 - task: CopyFiles@2
120   inputs:
121     contents: NetHackPackage_StoreKey.pfx
122     SourceFolder: $(Agent.TempDirectory)
123     TargetFolder: $(Agent.BuildDirectory)/$(netHackPath)/sys/windows/vs
124   condition: eq( variables.toolchain, 'vs' )
125   displayName: 'Copying store key'
127 - task: MSBuild@1
128   inputs:
129     solution: $(Agent.BuildDirectory)/$(netHackPath)/sys/windows/vs/NetHack.sln
130     platform: Win32
131     configuration: Debug
132   condition: eq( variables.toolchain, 'vs' )
133   displayName: 'Visual Studio Build'
135 - bash: |
136     export ADD_LUA=Y
137     export WANT_LUAC=N
138     export LUATOP=../submodules/lua
139     export LUASRC=../submodules/lua
140     export ADD_CURSES=Y
141     export PDCURSES_TOP=../submodules/pdcursesmod
142     export LUA_VERSION=5.4.6
143     #
144     # 64-bit
145     #export CURLSRC=https://github.com/brechtsanders/winlibs_mingw/releases/download/11.2.0-9.0.0-ucrt-r5/winlibs-x86_64-posix-seh-gcc-11.2.0-mingw-w64ucrt-9.0.0-r5.zip
146     #export CURLDST=mingw-x64.zip
147     #export MINGWBIN=mingw64
148     #export MSYSTEM=MINGW64
149     #
150     # 32-bit
151     export CURLSRC=https://github.com/brechtsanders/winlibs_mingw/releases/download/11.2.0-9.0.0-ucrt-r5/winlibs-i686-posix-dwarf-gcc-11.2.0-mingw-w64ucrt-9.0.0-r5.zip
152     export CURLDST=mingw-x86.zip
153     export MINGWBIN=mingw32
154     export MSYSTEM=MINGW32
155     # all
156     mkdir -p ../lib
157     cd ../lib
158     mkdir -p mingw
159     curl -L $CURLSRC -o $CURLDST
160     #tar -C mingw -xvf $CURLDST
161     #/c/Windows/System32/tar -C mingw -xvf $CURLDST
162     powershell -command "Expand-Archive -Force $CURLDST mingw"
163     export PATH=../lib/mingw/$MINGWBIN/bin:$PATH
164     export
165     cd ../src
166     pwd
167     cp ../sys/windows/Makefile.mingw32* .
168     mingw32-make -f Makefile.mingw32 CI_COMPILER=1 GIT=1 MSYSTEM=$MSYSTEM LUA_VERSION=$LUA_VERSION clean
169     mingw32-make -f Makefile.mingw32 CI_COMPILER=1 GIT=1 MSYSTEM=$MSYSTEM LUA_VERSION=$LUA_VERSION depend
170     mingw32-make -f Makefile.mingw32 CI_COMPILER=1 GIT=1 MSYSTEM=$MSYSTEM LUA_VERSION=$LUA_VERSION
171   condition: eq( variables.toolchain, 'mingw' )
172   workingDirectory: $(Agent.BuildDirectory)/$(netHackPath)/src
173   displayName: 'MinGW Build'
175 - bash: |
176     sudo apt-get -qq -y update
177     sudo apt-get -qq -y install libncurses5-dev
178     sudo apt-get -qq -y install libx11-dev libxaw7-dev xfonts-utils qtbase5-dev qtmultimedia5-dev qtbase5-dev-tools
179   condition: eq( variables['Agent.OS'], 'Linux' )
180   workingDirectory: $(Agent.BuildDirectory)/$(netHackPath)
181   displayName: 'Getting linux build dependencies'
183 - bash: |
184     cd sys/unix
185     sh setup.sh hints/linux.370
186     cd ../..
187     make fetch-lua
188     make WANT_WIN_ALL=1 QT_SELECT=5 MOC=moc all
189   condition: and(eq( variables['Agent.OS'], 'Linux' ), eq( variables.buildTarget, 'all'))
190   workingDirectory: $(Agent.BuildDirectory)/$(netHackPath)
191   displayName: 'Building linux full build'
193 - bash: |
194     cd sys/unix
195     sh setup.sh hints/linux-minimal
196     cd ../..
197     sed -i '/^#define CLIPPING/d'       include/config.h
198     sed -i '/^#define COMPRESS/d'       include/config.h
199     #sed -i '/^#define DOAGAIN/d'        include/config.h
200     sed -i '/^#define DUMPLOG/d'        include/config.h
201     #sed -i '/^#define GDBPATH/d'        include/config.h
202     #sed -i '/^#define GREPPATH/d'       include/config.h
203     sed -i '/^#define INSURANCE/d'      include/config.h
204     sed -i '/^#define ENHANCED_SYMBOLS/d' include/config.h
205     sed -i '/^#define LOGFILE/d'        include/config.h
206     sed -i '/^#define NEWS/d'           include/config.h
207     sed -i '/^#define PANICLOG/d'       include/config.h
208     #sed -i '/^#define STATUS_HILITES/d' include/config.h
209     sed -i '/^#define SYSCF/d'          include/config.h
210     sed -i '/^#define USER_SOUNDS/d'    include/config.h
211     sed -i '/^#define XLOGFILE/d'       include/config.h
212     sed -i '/^#define HANGUPHANDLING/d' include/global.h
213     sed -i '/^#define MAIL/d'           include/unixconf.h
214     sed -i '/^#define SHELL/d'          include/unixconf.h
215     sed -i '/^#define SUSPEND/d'        include/unixconf.h
216     sed -i 's/^#define TEXTCOLOR//'     include/unixconf.h
217     make fetch-lua
218     make WANT_WIN_ALL=1 all
219   condition: and(eq( variables['Agent.OS'], 'Linux' ), eq( variables.buildTarget, 'minimal'))
220   displayName: 'Building linux minimal build'
221   workingDirectory: $(Agent.BuildDirectory)/$(netHackPath)
223 - bash: |
224     cd sys/unix
225     sh setup.sh hints/macos.370
226     cd ../..
227     make fetch-lua
228     make WANT_MACSOUND=1 all
229   condition: eq( variables['Agent.OS'], 'Darwin' )
230   workingDirectory: $(Agent.BuildDirectory)/$(netHackPath)
231   displayName: 'Building mac full build'
233 - bash: |
234     export GCCVER=gcc1220
235     cd sys/unix
236     sh setup.sh hints/linux.370
237     cd ../..
238     make fetch-lua
239     sh sys/msdos/fetch-cross-compiler.sh
240     retVal=$?
241     if [ $retVal -eq 0 ]; then
242         make LUA_VERSION=5.4.6 WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_MSDOS=1 package
243     fi
244   condition: and(eq( variables['Agent.OS'], 'Linux' ), eq( variables.toolchain, 'cross'))
245   workingDirectory: $(Agent.BuildDirectory)/$(netHackPath)
246   displayName: 'Building MSDOS build'
247 - bash: |
248     sudo apt-get install texlive
249     make Guidebook
250     make Guidebook.txt
251     make Guidebook.pdf
252   condition: and(eq( variables['Agent.OS'], 'Linux' ), eq( variables.toolchain, 'docs'))
253   workingDirectory: $(Agent.BuildDirectory)/$(netHackPath)
254   displayName: 'Building NetHack documentation'