1
1
name : Builds
2
2
3
+ defaults :
4
+ run :
5
+ shell : bash
6
+
3
7
on :
4
8
release :
5
9
types : [created]
14
18
ghc : ['8.10.1', '8.8.4', '8.8.3', '8.8.2', '8.6.5', '8.6.4']
15
19
os : [ubuntu-latest, macOS-latest, windows-latest]
16
20
exclude :
21
+ - os : windows-latest
22
+ ghc : ' 8.8.4' # also fails due to segfault :(
17
23
- os : windows-latest
18
24
ghc : ' 8.8.3' # fails due to segfault
19
25
- os : windows-latest
28
34
ghc-version : ${{ matrix.ghc }}
29
35
cabal-version : ' 3.2'
30
36
31
- - name : Cache Cabal
32
-
33
- with :
34
- path : ~/.cabal
35
- key : ${{ runner.OS }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal') }}
36
-
37
37
- name : Shorten binary names
38
- shell : bash
39
38
run : |
40
39
sed -i.bak -e 's/haskell-language-server/hls/g' \
41
40
-e 's/haskell_language_server/hls/g' \
45
44
46
45
- name : Set some window specific things
47
46
if : matrix.os == 'windows-latest'
48
- shell : bash
49
47
run : |
50
48
echo '::set-env name=EXE_EXT::.exe'
51
49
@@ -55,47 +53,68 @@ jobs:
55
53
echo '::set-env name=LINUX_CABAL_ARGS::--enable-executable-static --ghc-options=-split-sections'
56
54
57
55
- name : Build Server
58
- shell : bash
59
56
# Try building it twice in case of flakey builds on Windows
60
57
run : |
61
- cabal build exe:hls -O2 --disable-documentation $LINUX_CABAL_ARGS || \
62
- cabal build exe:hls -O2 --disable-documentation $LINUX_CABAL_ARGS
58
+ cabal build exe:hls -O2 $LINUX_CABAL_ARGS || \
59
+ cabal build exe:hls -O2 $LINUX_CABAL_ARGS -j1
63
60
64
- - name : Find Server Binary
65
- id : find_server_binary
66
- shell : bash
61
+ - name : Compress Server Binary
62
+ id : compress_server_binary
63
+ env :
64
+ GHC_VER : ${{ matrix.ghc }}
67
65
run : |
68
- HLS=$(find dist-newstyle \( -name 'hls' -o -name 'hls.exe' \) -type f)
69
- gzip --best $HLS
70
- echo ::set-output name=hls_binary::$HLS.gz
66
+ HLS_BUILD=$(find dist-newstyle \( -name 'hls' -o -name 'hls.exe' \) -type f)
67
+ HLS=haskell-language-server-$GHC_VER
68
+ mv $HLS_BUILD $HLS
69
+ if [[ "$OSTYPE" == "msys" ]]; then
70
+ 7z a $HLS.zip $HLS
71
+ echo ::set-output name=path::$HLS.zip
72
+ echo ::set-output name=content_type::application/zip
73
+ echo ::set-output name=extension::zip
74
+ else
75
+ gzip --best $HLS
76
+ echo ::set-output name=path::$HLS.gz
77
+ echo ::set-output name=content_type::application/gzip
78
+ echo ::set-output name=extension::gz
79
+ fi
71
80
72
81
- name : Upload Server Binary
73
82
74
83
env :
75
84
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
76
85
with :
77
86
upload_url : ${{ github.event.release.upload_url }}
78
- asset_path : ${{ steps.find_server_binary .outputs.hls_binary }}
79
- asset_name : haskell-language-server-${{ runner.OS }}-${{ matrix.ghc }}${{env.EXE_EXT}}.gz
80
- asset_content_type : application/gzip
87
+ asset_path : ${{ steps.compress_server_binary .outputs.path }}
88
+ asset_name : haskell-language-server-${{ runner.OS }}-${{ matrix.ghc }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }}
89
+ asset_content_type : ${{ steps.compress_server_binary.outputs.content_type }}
81
90
82
91
- uses : actions/upload-artifact@v2
83
92
with :
84
93
name : haskell-language-server-${{ runner.OS }}-${{ matrix.ghc }}${{env.EXE_EXT}}.gz
85
- path : ${{ steps.find_server_binary .outputs.hls_binary }}
94
+ path : ${{ steps.compress_server_binary .outputs.path }}
86
95
87
96
- name : Build Wrapper
88
97
if : matrix.ghc == '8.10.1'
89
- run : cabal build exe:hls-wrapper -O2 --disable-documentation $WIN_CABAL_ARGS $LINUX_CABAL_ARGS
98
+ run : cabal build exe:hls-wrapper -O2 $LINUX_CABAL_ARGS
90
99
91
- - name : Find Wrapper Binary
100
+ - name : Compress Wrapper Binary
92
101
if : matrix.ghc == '8.10.1'
93
- id : find_wrapper_binary
94
- shell : bash
102
+ id : compress_wrapper_binary
95
103
run : |
96
- HLS_WRAPPER=$(find dist-newstyle \( -name 'hls-wrapper' -o -name 'hls-wrapper.exe' \) -type f)
97
- gzip --best $HLS_WRAPPER
98
- echo ::set-output name=hls_wrapper_binary::$HLS_WRAPPER.gz
104
+ HLS_WRAPPER_BUILD=$(find dist-newstyle \( -name 'hls-wrapper' -o -name 'hls-wrapper.exe' \) -type f)
105
+ HLS_WRAPPER=haskell-language-server-wrapper
106
+ mv $HLS_WRAPPER_BUILD $HLS_WRAPPER
107
+ if [[ "$OSTYPE" == "msys" ]]; then
108
+ 7z a $HLS_WRAPPER.zip $HLS_WRAPPER
109
+ echo ::set-output name=path::$HLS_WRAPPER.zip
110
+ echo ::set-output name=content_type::application/zip
111
+ echo ::set-output name=extension::zip
112
+ else
113
+ gzip --best $HLS_WRAPPER
114
+ echo ::set-output name=path::$HLS_WRAPPER.gz
115
+ echo ::set-output name=content_type::application/gzip
116
+ echo ::set-output name=extension::gz
117
+ fi
99
118
100
119
- name : Upload Wrapper
101
120
if : matrix.ghc == '8.10.1'
@@ -104,13 +123,13 @@ jobs:
104
123
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
105
124
with :
106
125
upload_url : ${{ github.event.release.upload_url }}
107
- asset_path : ${{ steps.find_wrapper_binary .outputs.hls_wrapper_binary }}
108
- asset_name : haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.gz
109
- asset_content_type : application/gzip
126
+ asset_path : ${{ steps.compress_wrapper_binary .outputs.path }}
127
+ asset_name : haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }}
128
+ asset_content_type : ${{ steps.compress_wrapper_binary.outputs.content_type}}
110
129
111
130
- uses : actions/upload-artifact@v2
112
131
if : matrix.ghc == '8.10.1'
113
132
with :
114
133
name : haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.gz
115
- path : ${{ steps.find_wrapper_binary .outputs.hls_wrapper_binary }}
134
+ path : ${{ steps.compress_wrapper_binary .outputs.path }}
116
135
0 commit comments