Commit 461ab941 authored by Jan-Philipp Stauffert's avatar Jan-Philipp Stauffert
Browse files

Merge branch '113-windows-build' into 'master'

Resolve "Build system on Windows"

Closes #113

See merge request decker/decker!65
parents 6aa036f6 b5e3e837
......@@ -53,6 +53,23 @@ build:mac:
paths:
- decker
build:win:
tags:
- win
stage: build
script:
- '&.\bin\build.ps1 preextracted -skiptemplates -preparepackage'
artifacts:
paths:
- decker.exe
- resource.zip
- version.txt
cache:
key: build-win
paths:
- .stack-work
test:linux:
stage: test
tags:
......@@ -113,5 +130,24 @@ deploy:linux:
- mc cp ./decker store/decker/decker-linux
dependencies:
- build:linux
only:
- master
deploy:win:
stage: deploy
image:
name: minio/mc:latest
entrypoint: [""]
variables:
GIT_STRATEGY: none
tags:
- docker
script:
- mc config host add store http://store.hci.informatik.uni-wuerzburg.de:9002 $MINIO_ACCESS $MINIO_SECRET --api S3v4
- mc cp ./decker.exe store/decker/decker-win.exe
- mc cp ./resource.zip store/decker/resource-win.zip
- mc cp ./version.txt store/decker/version-win.txt
dependencies:
- build:win
only:
- master
\ No newline at end of file
<#
.SYNOPSIS
Builds Decker for windows
.DESCRIPTION
Build script to build Decker for windows. Allows to set the build
mode via parameters for custom builds in the CI pipeline.
.PARAMETER buildtype
Defaults to assume preextracted resources for the build.
If set to any other value will include the resources in the executable.
#>
Param(
[string] $buildtype = "preextracted",
[switch] $skiptemplates,
[switch] $preparepackage
)
Write-Output "Building Windows Decker"
if(-Not $skiptemplates) {
& yarn install
& yarn run webpack --mode production
Copy-Item -Recurse -Force node_modules/reveal.js-menu resource/support/
New-Item -ItemType directory -Force -Path resource/support/notes
Copy-Item -Force node_modules/reveal.js/plugin/notes/notes.html resource/support/notes/notes.html
Copy-Item -Force node_modules/reveal.js/plugin/notes/notes.js resource/support/notes/notes.js
New-Item -ItemType directory -Force -Path resource/support/print
Copy-Item -Force node_modules/reveal.js/css/print/paper.css resource/support/print/paper.css
Copy-Item -Force node_modules/reveal.js/css/print/pdf.css resource/support/print/pdf.css
}
if($buildtype -eq "preextracted"){
Write-Output "Building for preextracted resources"
& stack build -j4 --flag decker:preextractedresources
} else {
Write-Output "Building standalone binary"
& stack build -j4
}
if($preparepackage) {
$binpath=(Join-Path ($(stack path | Select-String -Pattern "local-install-root") -split " ")[1] "bin\decker.exe")
Copy-Item $binpath .
$version = Get-Content .\package.yaml | Select-String -Pattern "version: "
$version = $version -replace "\s+", " "
$version = ($version -split " ")[1]
Write-Output $version > version.txt
Compress-Archive -Force -Path .\resource -CompressionLevel Fastest -DestinationPath resource
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ module System.Decker.OS
) where
import Common
import Data.List
import System.Environment
import System.FilePath
......
......@@ -203,7 +203,7 @@ fileIsNewer a b = do
-- Both arguments are expected to be absolute pathes.
makeRelativeTo :: FilePath -> FilePath -> FilePath
makeRelativeTo dir file =
let (d, f) = removeCommonPrefix (dir, file)
let (d, f) = removeCommonPrefix (normalise dir, normalise file)
in normalise $ invertPath d </> f
invertPath :: FilePath -> FilePath
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment