Skip to content

Commit adb964c

Browse files
authored
Semiautomatic hackage releases (#2163)
* Including the update of some .cabal files to make `cabal check` happy
1 parent d1d7ce0 commit adb964c

File tree

9 files changed

+150
-5
lines changed

9 files changed

+150
-5
lines changed

.github/workflows/hackage.yml

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Hackage
2+
3+
on:
4+
push:
5+
branches:
6+
- '*-hackage'
7+
8+
jobs:
9+
check-and-upload-tarballs:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
package: ["hie-compat", "hls-graph", "shake-bench",
14+
"hls-plugin-api", "ghcide", "hls-test-utils",
15+
"hls-brittany-plugin", "hls-floskell-plugin", "hls-fourmolu-plugin",
16+
"hls-ormolu-plugin", "hls-stylish-haskell-plugin",
17+
"hls-class-plugin", "hls-eval-plugin", "hls-explicit-imports-plugin",
18+
"hls-haddock-comments-plugin", "hls-hlint-plugin",
19+
"hls-module-name-plugin", "hls-pragmas-plugin",
20+
"hls-refine-imports-plugin", "hls-retrie-plugin",
21+
"hls-splice-plugin", "hls-tactics-plugin",
22+
"hls-call-hierarchy-plugin",
23+
"haskell-language-server"]
24+
ghc: ["8.10.7", "8.8.4", "8.6.5"]
25+
26+
steps:
27+
28+
- uses: actions/checkout@v2
29+
with:
30+
submodules: true
31+
32+
- uses: haskell/actions/setup@v1
33+
with:
34+
ghc-version: ${{ matrix.ghc }}
35+
cabal-version: '3.4'
36+
37+
- name: Cache Cabal
38+
uses: actions/cache@v2
39+
env:
40+
cache-name: cache-cabal
41+
with:
42+
path: |
43+
~/.cabal/packages
44+
~/.cabal/store
45+
key: v2-${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }}
46+
restore-keys: |
47+
v2-${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }}
48+
v2-${{ runner.os }}-${{ matrix.ghc }}-build-
49+
v2-${{ runner.os }}-${{ matrix.ghc }}
50+
51+
- name: "Run cabal check"
52+
run: |
53+
if [[ ${{ matrix.package }} == *plugin ]]; then
54+
cd plugins
55+
fi
56+
if [[ ${{ matrix.package }} != haskell-language-server ]]; then
57+
cd ${{ matrix.package }}
58+
fi
59+
cabal check
60+
61+
- name: "Generate package dist tarball"
62+
id: generate-dist-tarball
63+
run: |
64+
if [[ ${{ matrix.package }} == haskell-language-server ]]; then
65+
cabal sdist --builddir=./
66+
else
67+
cabal sdist ${{ matrix.package }} --builddir=./
68+
fi
69+
echo ::set-output name=path::$(ls ./sdist/${{ matrix.package }}-*)
70+
71+
- name: "Unpack package source in an isolated location"
72+
run: cabal unpack ${{ steps.generate-dist-tarball.outputs.path }} --destdir=./incoming
73+
74+
- name: "Try to get the current hackage version"
75+
id: get-hackage-version
76+
run: |
77+
cd ./incoming
78+
if cabal get $(ls -d ${{ matrix.package }}-*) --destdir=../current; then
79+
echo ::set-output name=exists::true
80+
fi
81+
82+
- name: "Compare the incoming and the current hackage version of the package"
83+
id: compare-current-version
84+
if: steps.get-hackage-version.exists == 'true'
85+
run: |
86+
# This will throw an error if there is any difference cause we have to bump up the package version
87+
diff -qr -x "*.md" -x "data" $(ls -d ./incoming/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*)
88+
89+
- name: "Create appropiate cabal.project"
90+
if: steps.get-hackage-version.exists != 'true'
91+
run: |
92+
cd $(ls -d ./incoming/${{ matrix.package }}-*)
93+
echo "packages: . ../../* ../../plugins/*" > cabal.project
94+
# TODO: remove when not needed
95+
echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core" >> cabal.project
96+
97+
- name: "Build all package components in isolation"
98+
if: steps.get-hackage-version.exists != 'true'
99+
run: |
100+
cd $(ls -d ./incoming/${{ matrix.package }}-*)
101+
cabal build --enable-tests --enable-benchmarks
102+
103+
- name: "Generate haddock for hackage"
104+
if: steps.get-hackage-version.exists != 'true'
105+
run: |
106+
cd $(ls -d ./incoming/${{ matrix.package }}-*)
107+
cabal haddock --haddock-for-hackage
108+
109+
- name: "Upload package dist tarball"
110+
if: steps.get-hackage-version.exists != 'true'
111+
uses: actions/upload-artifact@v2
112+
with:
113+
name: ${{ matrix.package }}
114+
path: ${{ steps.generate-dist-tarball.outputs.path }}
115+
116+
upload-candidate:
117+
needs: check-and-upload-tarballs
118+
runs-on: ubuntu-latest
119+
steps:
120+
121+
- uses: actions/download-artifact@v2
122+
with:
123+
path: packages
124+
125+
- name: "Join all tarballs"
126+
run: find ./packages -type f -name '*.tar.gz' -exec cp {} ./packages \;
127+
128+
- name: "Upload all tarballs to hackage"
129+
uses: haskell-actions/hackage-publish@v1
130+
with:
131+
hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }}
132+
packagesPath: packages
133+
publish: false

plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ cabal-version: 2.4
22
name: hls-call-hierarchy-plugin
33
version: 1.0.0.2
44
synopsis: Call hierarchy plugin for Haskell Language Server
5+
description:
6+
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server/tree/master/plugins/hls-call-hierarchy-plugin#readme>
7+
58
license: Apache-2.0
69
license-file: LICENSE
710
author: Lei Zhu
@@ -21,7 +24,7 @@ library
2124

2225
hs-source-dirs: src
2326
build-depends:
24-
, aeson
27+
, aeson >=1.5.2.0
2528
, base >=4.12 && <5
2629
, bytestring
2730
, containers

plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ cabal-version: 2.2
22
name: hls-explicit-imports-plugin
33
version: 1.0.0.4
44
synopsis: Explicit imports plugin for Haskell Language Server
5+
description:
6+
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
57
license: Apache-2.0
68
license-file: LICENSE
79
author: Pepe Iborra

plugins/hls-hlint-plugin/hls-hlint-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: hls-hlint-plugin
33
version: 1.0.1.1
44
synopsis: Hlint integration plugin with Haskell Language Server
55
description:
6-
Please see Haskell Language Server Readme (https://github.com/haskell/haskell-language-server#readme)
6+
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
77

88
license: Apache-2.0
99
license-file: LICENSE

plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
cabal-version: 2.2
1+
cabal-version: 2.4
22
name: hls-refine-imports-plugin
33
version: 1.0.0.1
44
synopsis: Refine imports plugin for Haskell Language Server
5+
description:
6+
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
57
license: Apache-2.0
68
license-file: LICENSE
79
author: rayshih

plugins/hls-retrie-plugin/hls-retrie-plugin.cabal

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ cabal-version: 2.2
22
name: hls-retrie-plugin
33
version: 1.0.1.1
44
synopsis: Retrie integration plugin for Haskell Language Server
5+
description:
6+
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
57
license: Apache-2.0
68
license-file: LICENSE
79
author: Pepe Iborra

plugins/hls-splice-plugin/hls-splice-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ synopsis:
55
HLS Plugin to expand TemplateHaskell Splices and QuasiQuotes
66

77
description:
8-
HLS Plugin to expand TemplateHaskell Splices and QuasiQuotes.
8+
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
99

1010
license: Apache-2.0
1111
license-file: LICENSE

plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ cabal-version: 2.4
22
name: hls-stylish-haskell-plugin
33
version: 1.0.0.2
44
synopsis: Integration with the Stylish Haskell code formatter
5+
description:
6+
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
57
license: Apache-2.0
68
license-file: LICENSE
79
author: The Haskell IDE Team

plugins/hls-tactics-plugin/hls-tactics-plugin.cabal

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ category: Development
33
name: hls-tactics-plugin
44
version: 1.3.0.0
55
synopsis: Wingman plugin for Haskell Language Server
6-
description: Please see README.md
6+
description:
7+
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
78
author: Sandy Maguire, Reed Mullanix
89
maintainer: sandy@sandymaguire.me
910
copyright: Sandy Maguire, Reed Mullanix

0 commit comments

Comments
 (0)