Skip to content

Commit

Permalink
AppVeyor: Tweak config & switch to CI GitHub release
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Dec 5, 2017
1 parent 889fcda commit 7c7c442
Showing 1 changed file with 26 additions and 48 deletions.
74 changes: 26 additions & 48 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,18 @@

#version: 1.0.{build}-{branch}

# Do not build on tags (GitHub only)
skip_tags: true

#---------------------------------#
# environment configuration #
#---------------------------------#

environment:
matrix:
- APPVEYOR_JOB_ARCH: x64
- APPVEYOR_JOB_ARCH: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
D_COMPILER: ldc
- APPVEYOR_JOB_ARCH: x86
D_COMPILER: ldc
- APPVEYOR_JOB_ARCH: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
D_COMPILER: ldc

#matrix:
# allow_failures:
# - APPVEYOR_JOB_ARCH: x86
D_COMPILER: ldc

# scripts that are called at very beginning, before repo cloning
init:
Expand All @@ -42,12 +35,12 @@ install:
- 7z x ..\libcurl.zip > nul
- cd ..
# Copy libcurl.dll to final LDC installation directory and add to PATH
- md ldc-%APPVEYOR_JOB_ARCH% && md ldc-%APPVEYOR_JOB_ARCH%\bin
- if "%APPVEYOR_JOB_ARCH%"=="x64" ( copy libcurl\dmd2\windows\bin64\libcurl.dll ldc-x64\bin )
- if "%APPVEYOR_JOB_ARCH%"=="x86" ( copy libcurl\dmd2\windows\bin\libcurl.dll ldc-x86\bin )
- set PATH=%CD%\ldc-%APPVEYOR_JOB_ARCH%\bin;%PATH%
- md ldc2-%APPVEYOR_JOB_ARCH% && md ldc2-%APPVEYOR_JOB_ARCH%\bin
- if "%APPVEYOR_JOB_ARCH%"=="x64" ( copy libcurl\dmd2\windows\bin64\libcurl.dll ldc2-x64\bin )
- if "%APPVEYOR_JOB_ARCH%"=="x86" ( copy libcurl\dmd2\windows\bin\libcurl.dll ldc2-x86\bin )
- set PATH=%CD%\ldc2-%APPVEYOR_JOB_ARCH%\bin;%PATH%
# Download & extract Ninja
- appveyor DownloadFile "https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip" -FileName ninja.zip
- appveyor DownloadFile "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip" -FileName ninja.zip
- md ninja
- cd ninja
- 7z x ..\ninja.zip > nul
Expand All @@ -60,12 +53,12 @@ install:
# Download & extract D compiler
- ps: |
If ($Env:D_COMPILER -eq 'dmd') {
$dmdVersion = '2.075.1'
$dmdVersion = '2.077.1'
appveyor DownloadFile "http://downloads.dlang.org/releases/2.x/$dmdVersion/dmd.$dmdVersion.windows.7z" -FileName dmd2.7z
7z x dmd2.7z > $null
Set-Item -path env:DMD -value c:\projects\dmd2\windows\bin\dmd.exe
} Else {
$ldcVersion = '1.3.0'
$ldcVersion = '1.6.0'
If ($Env:APPVEYOR_JOB_ARCH -eq 'x64') {
appveyor DownloadFile "http://github.com/ldc-developers/ldc/releases/download/v$ldcVersion/ldc2-$ldcVersion-win64-msvc.zip" -FileName ldc2.zip
7z x ldc2.zip > $null
Expand Down Expand Up @@ -105,27 +98,24 @@ install:
# build configuration #
#---------------------------------#

before_build:

build_script:
- cd c:\projects
# Generate build files for LDC
- md ninja-ldc
- cd ninja-ldc
- cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=c:\projects\ldc-%APPVEYOR_JOB_ARCH% -DLLVM_ROOT_DIR=c:/projects/llvm ..\ldc
- cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=c:\projects\ldc2-%APPVEYOR_JOB_ARCH% -DINCLUDE_INSTALL_DIR=c:/projects/ldc2-%APPVEYOR_JOB_ARCH%/import -DLLVM_ROOT_DIR=c:/projects/llvm ..\ldc
# Build LDC and stdlib unittest runners
- ninja -j2 all all-test-runners

after_build:
# install LDC, compress & publish as artifact
# Install LDC, pack & publish as artifact
- ps: |
echo 'Preparing artifact...'
cd c:\projects\ninja-ldc
ninja install > $null
copy bin\ldc2.pdb "..\ldc-$Env:APPVEYOR_JOB_ARCH\bin"
cd "..\ldc-$Env:APPVEYOR_JOB_ARCH"
(gc etc\ldc2.conf).replace("C:/projects/ldc-$Env:APPVEYOR_JOB_ARCH/", '%%ldcbinarypath%%/../') | sc etc\ldc2.conf
$artifactFilename = "LDC-master-$Env:APPVEYOR_BUILD_NUMBER-$Env:APPVEYOR_JOB_ARCH.7z"
cd "..\ldc2-$Env:APPVEYOR_JOB_ARCH"
(gc etc\ldc2.conf).replace("C:/projects/ldc2-$Env:APPVEYOR_JOB_ARCH/", '%%ldcbinarypath%%/../') | sc etc\ldc2.conf
$artifactFilename = "ldc2-$($Env:APPVEYOR_REPO_COMMIT.Substring(0, 8))-windows-$Env:APPVEYOR_JOB_ARCH.7z"
7z a "..\$artifactFilename" * > $null
cd ..
Push-AppveyorArtifact $artifactFilename
Expand All @@ -139,26 +129,27 @@ after_build:
cd c:\projects
$artifact64Downloaded = $True
Try {
(New-Object Net.WebClient).DownloadFile("https://github.com/ldc-developers/ldc/releases/download/LDC-Win64-master/LDC-master-$Env:APPVEYOR_BUILD_NUMBER-x64.7z", 'c:\projects\LDC-master-x64.7z')
(New-Object Net.WebClient).DownloadFile("https://github.com/ldc-developers/ldc/releases/download/CI/ldc2-$($Env:APPVEYOR_REPO_COMMIT.Substring(0, 8))-windows-x64.7z", 'c:\projects\ldc2-x64.7z')
}
Catch {
echo 'Failed to download the 64-bit artifact from GitHub (the x64 job probably failed).'
echo 'Skipping the 32/64-bit multilib artifact.'
$artifact64Downloaded = $False
}
If ($artifact64Downloaded) {
md ldc-multilib > $null
cd ldc-multilib
7z x ..\LDC-master-x64.7z > $null
md ldc2-multilib > $null
cd ldc2-multilib
7z x ..\ldc2-x64.7z > $null
del ..\ldc2-x64.7z
ren lib lib64
copy ..\ldc-x86\lib -Recurse
copy ..\ldc2-x86\lib -Recurse
ren lib lib32
(gc etc\ldc2.conf).replace('%%ldcbinarypath%%/../lib', '%%ldcbinarypath%%/../lib64') | sc etc\ldc2.conf
$conf32 = gc ..\ldc-x86\etc\ldc2.conf -Raw
$conf32 = gc ..\ldc2-x86\etc\ldc2.conf -Raw
$conf32 = "`r`ni686-pc-windows-msvc:" + $conf32.Substring($conf32.IndexOf("`r`ndefault:") + 10)
$conf32 = $conf32.Replace('%%ldcbinarypath%%/../lib', '%%ldcbinarypath%%/../lib32')
ac etc\ldc2.conf $conf32
$artifactFilename = "LDC-master-$Env:APPVEYOR_BUILD_NUMBER-multilib.7z"
$artifactFilename = "ldc2-$($Env:APPVEYOR_REPO_COMMIT.Substring(0, 8))-windows-multilib.7z"
7z a "..\$artifactFilename" * > $null
cd ..
Push-AppveyorArtifact $artifactFilename
Expand Down Expand Up @@ -189,23 +180,10 @@ test_script:

deploy:
- provider: GitHub
release: 'LDC Win64 master'
description: "Latest successful Windows CI builds of branch 'master'"
draft: true
prerelease: true
auth_token:
secure: qnbD8agL9mr0SFvy/sMkR2E29oQQ427T5zYwVVZkjRS3IZ361tG+9jlSiyEkyULy
artifact: LDC-master-$(APPVEYOR_BUILD_NUMBER)-$(APPVEYOR_JOB_ARCH).7z
on:
branch: master
- provider: GitHub
release: 'LDC Win64 master'
description: "Latest successful Windows CI builds of branch 'master'"
draft: true
release: CI
prerelease: true
auth_token:
secure: qnbD8agL9mr0SFvy/sMkR2E29oQQ427T5zYwVVZkjRS3IZ361tG+9jlSiyEkyULy
artifact: LDC-master-$(APPVEYOR_BUILD_NUMBER)-multilib.7z
artifact: /ldc2-.*\.7z/
on:
branch: master
APPVEYOR_JOB_ARCH: x86

0 comments on commit 7c7c442

Please sign in to comment.