-
-
Notifications
You must be signed in to change notification settings - Fork 256
104 lines (84 loc) · 4.49 KB
/
listener-build-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: build-listener-windows
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
ghc: ['9.0.1']
cabal: ['3.4.0.0']
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup Haskell
uses: haskell/actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Freeze
run: |
cabal freeze
- name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
uses: actions/cache@v2
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('tidal-listener/src') }}
- name: cabal build
run: |
cabal update
cabal build --enable-tests tidal-listener
cabal build
- name: remove unneccessary libs
run: |
Remove-Item 'C:\tools\ghc-${{ matrix.ghc }}\lib\ghc-${{ matrix.ghc }}' -Recurse -ErrorAction Ignore
Remove-Item 'C:\tools\ghc-${{ matrix.ghc }}\lib\Cabal-*' -Recurse -ErrorAction Ignore
Remove-Item 'C:\tools\ghc-${{ matrix.ghc }}\lib\rts' -Recurse -ErrorAction Ignore
- name: move GHC libs and configs
run: |
Copy-Item -Path 'C:\tools\ghc-${{ matrix.ghc }}\lib\' -Recurse -Destination 'tidal-listener\binary\haskell-libs\ghc-packages'
Move-Item -Path 'tidal-listener\binary\haskell-libs\ghc-packages\settings' -Destination 'tidal-listener\binary\haskell-libs\settings'
Move-Item -Path 'tidal-listener\binary\haskell-libs\ghc-packages\llvm-passes' -Destination 'tidal-listener\binary\haskell-libs\llvm-passes'
Move-Item -Path 'tidal-listener\binary\haskell-libs\ghc-packages\llvm-targets' -Destination 'tidal-listener\binary\haskell-libs\llvm-targets'
Move-Item -Path 'tidal-listener\binary\haskell-libs\ghc-packages\platformConstants' -Destination 'tidal-listener\binary\haskell-libs\platformConstants'
- name: move mingw
run: Copy-Item -Path 'C:\tools\ghc-${{ matrix.ghc }}\mingw\' -Recurse -Destination 'tidal-listener\binary\mingw'
- name: move installed packages
run: Copy-Item -Path 'C:\sr\ghc-${{ matrix.ghc }}\' -Recurse -Destination 'tidal-listener\binary\haskell-libs\packages'
- name: change paths in config files (packages)
run: |
Move-Item -Path 'tidal-listener\binary\haskell-libs\packages\package.db\' -Destination 'tidal-listener\binary\haskell-libs\package.db\'
$configs = Get-ChildItem 'tidal-listener\binary\haskell-libs\package.db\' -Recurse
$configs | %{ (gc $_) -replace "C:\\sr\\ghc-${{ matrix.ghc }}", '$topdir\packages' | Set-Content $_.fullname}
- name: move ghc package config
run: |
Move-Item -Path 'tidal-listener\binary\haskell-libs\ghc-packages\package.conf.d\' -Destination 'tidal-listener\binary\haskell-libs\package.conf.d\'
$configs = Get-ChildItem 'tidal-listener\binary\haskell-libs\package.conf.d\' -Recurse
$configs | %{ (gc $_) -replace 'topdir', 'topdir\ghc-packages' | Set-Content $_.fullname}
- name: ghc-pkg recache
run: |
$ENV:GHC_PACKAGE_PATH="tidal-listener\binary\haskell-libs\package.conf.d;tidal-listener\binary\haskell-libs\package.db"
ghc-pkg -v2 recache --package-db="tidal-listener\binary\haskell-libs\package.conf.d"
ghc-pkg -v2 recache --package-db="tidal-listener\binary\haskell-libs\package.db"
- name: move executables
run: |
Copy-Item -Path 'dist-newstyle\build\x86_64-windows\ghc-${{ matrix.ghc }}\tidal-listener-0.1.0.0\x\tidal-listener\build\tidal-listener\tidal-listener.exe' -Recurse -Destination 'tidal-listener\binary\tidal-listener.exe'
# Copy-Item -Path 'dist-newstyle\build\x86_64-windows\ghc-${{ matrix.ghc }}\tidal-*\x\tidal\build\tidal\tidal.exe' -Recurse -Destination 'tidal-listener\binary\tidal.exe'
- name: zip files
run: Compress-Archive -LiteralPath 'tidal-listener\binary\' -DestinationPath 'tidal-listener\windows.zip'
- uses: actions/upload-artifact@v2
with:
path: tidal-listener\windows.zip
release:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v2
- run: ls */*
- uses: softprops/action-gh-release@v1
with:
files: artifact/windows.zip