Skip to content

Commit b5a37f7

Browse files
authored
Merge pull request #2850 from haskell/wip/1.7-release-scripts
Add scripts for releases and final 1.7 tweaks
2 parents 24e3e13 + 18af8aa commit b5a37f7

File tree

28 files changed

+270
-31
lines changed

28 files changed

+270
-31
lines changed

.gitlab-ci.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@ variables:
1313

1414
.windows_matrix: &windows_matrix
1515
matrix:
16-
- GHC_VERSION: 8.8.4
17-
CABAL_PROJECT: cabal.project
1816
- GHC_VERSION: 8.10.7
1917
CABAL_PROJECT: cabal.project
2018
- GHC_VERSION: 9.0.2
2119
CABAL_PROJECT: cabal-ghc90.project
22-
- GHC_VERSION: 9.2.1
23-
CABAL_PROJECT: cabal-ghc92.project
2420
- GHC_VERSION: 9.2.2
2521
CABAL_PROJECT: cabal-ghc92.project
22+
- GHC_VERSION: 9.2.1
23+
CABAL_PROJECT: cabal-ghc92.project
2624

2725
workflow:
2826
rules:

.gitlab/tar.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ls -la out/
1010
TARBALL_PREFIX="haskell-language-server"
1111
case "${TARBALL_EXT}" in
1212
zip)
13-
HLS_VERSION="$("$CI_PROJECT_DIR/out/haskell-language-server-wrapper" --numeric-version)"
13+
HLS_VERSION="$("$CI_PROJECT_DIR/out/haskell-language-server-8.10.7" --numeric-version)"
1414
cd out/
1515
zip "${TARBALL_PREFIX}-${HLS_VERSION}-${TARBALL_ARCHIVE_SUFFIX}.zip" haskell-language-server-*
1616
find . -type f ! -name '*.zip' -delete

GNUmakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ define set_rpath
6666
endef
6767

6868
hls: bindist/ghcs
69-
for ghc in $(shell [ -e "bindist/ghcs-`uname`" ] && cat "bindist/ghcs-`uname`" || cat "bindist/ghcs") ; do \
69+
for ghc in $(shell [ -e "bindist/ghcs-`uname -o`" ] && cat "bindist/ghcs-`uname -o`" || cat "bindist/ghcs") ; do \
7070
$(GHCUP) -v install ghc `echo $$ghc | $(AWK) -F ',' '{ print $$1 }'` && \
7171
$(GHCUP) -v gc -p -s -c && \
7272
$(MAKE) GHC_VERSION=`echo $$ghc | $(AWK) -F ',' '{ print $$1 }'` PROJECT_FILE=`echo $$ghc | $(AWK) -F ',' '{ print $$2 }'` hls-ghc && \

bindist/ghcs-Msys

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
8.10.7,cabal.project
2+
9.0.2,cabal-ghc90.project
3+
9.2.2,cabal-ghc92.project
4+
9.2.1,cabal-ghc92.project

haskell-language-server.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ test-suite func-test
477477
, lens
478478
, lens-aeson
479479
, ghcide
480-
, hls-test-utils ^>=1.2
480+
, hls-test-utils ^>=1.3
481481
, lsp-types
482482
, aeson
483483
, hls-plugin-api

hls-test-utils/hls-test-utils.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.4
22
name: hls-test-utils
3-
version: 1.2.0.0
3+
version: 1.3.0.0
44
synopsis: Utilities used in the tests of Haskell Language Server
55
description:
66
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>

plugins/hls-alternate-number-format-plugin/hls-alternate-number-format-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ test-suite tests
5757
, base >=4.12 && < 5
5858
, filepath
5959
, hls-alternate-number-format-plugin
60-
, hls-test-utils ^>=1.2
60+
, hls-test-utils ^>=1.3
6161
, lsp
6262
, QuickCheck
6363
, regex-tdfa

plugins/hls-brittany-plugin/hls-brittany-plugin.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.4
22
name: hls-brittany-plugin
3-
version: 1.0.2.0
3+
version: 1.0.2.1
44
synopsis: Integration with the Brittany code formatter
55
description:
66
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
@@ -48,4 +48,4 @@ test-suite tests
4848
, base
4949
, filepath
5050
, hls-brittany-plugin
51-
, hls-test-utils ^>=1.2
51+
, hls-test-utils ^>=1.3

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test-suite tests
5555
, extra
5656
, filepath
5757
, hls-call-hierarchy-plugin
58-
, hls-test-utils ^>=1.2
58+
, hls-test-utils ^>=1.3
5959
, lens
6060
, lsp
6161
, lsp-test

plugins/hls-change-type-signature-plugin/hls-change-type-signature-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ test-suite tests
5454
, base >=4.12 && < 5
5555
, filepath
5656
, hls-change-type-signature-plugin
57-
, hls-test-utils ^>=1.2
57+
, hls-test-utils ^>=1.3
5858
, lsp
5959
, QuickCheck
6060
, regex-tdfa

plugins/hls-class-plugin/hls-class-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ test-suite tests
5353
, base
5454
, filepath
5555
, hls-class-plugin
56-
, hls-test-utils ^>=1.2
56+
, hls-test-utils ^>=1.3
5757
, lens
5858
, lsp-types

plugins/hls-eval-plugin/hls-eval-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ test-suite tests
111111
, filepath
112112
, hls-eval-plugin
113113
, hls-plugin-api
114-
, hls-test-utils ^>=1.2
114+
, hls-test-utils ^>=1.3
115115
, lens
116116
, lsp-types
117117
, text

plugins/hls-floskell-plugin/hls-floskell-plugin.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.4
22
name: hls-floskell-plugin
3-
version: 1.0.1.0
3+
version: 1.0.1.1
44
synopsis: Integration with the Floskell code formatter
55
description:
66
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
@@ -40,4 +40,4 @@ test-suite tests
4040
, base
4141
, filepath
4242
, hls-floskell-plugin
43-
, hls-test-utils ^>=1.2
43+
, hls-test-utils ^>=1.3

plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ test-suite tests
5050
, filepath
5151
, hls-fourmolu-plugin
5252
, hls-plugin-api
53-
, hls-test-utils ^>=1.2
53+
, hls-test-utils ^>=1.3
5454
, lsp-test

plugins/hls-haddock-comments-plugin/hls-haddock-comments-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ test-suite tests
5050
, base
5151
, filepath
5252
, hls-haddock-comments-plugin
53-
, hls-test-utils ^>=1.2
53+
, hls-test-utils ^>=1.2 || ^>=1.3
5454
, text

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ test-suite tests
128128
, filepath
129129
, hls-hlint-plugin
130130
, hls-plugin-api
131-
, hls-test-utils ^>=1.2
131+
, hls-test-utils ^>=1.3
132132
, lens
133133
, lsp-types
134134
, text

plugins/hls-module-name-plugin/hls-module-name-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ test-suite tests
4444
, base
4545
, filepath
4646
, hls-module-name-plugin
47-
, hls-test-utils ^>=1.2
47+
, hls-test-utils ^>=1.3

plugins/hls-ormolu-plugin/hls-ormolu-plugin.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.4
22
name: hls-ormolu-plugin
3-
version: 1.0.2.0
3+
version: 1.0.2.1
44
synopsis: Integration with the Ormolu code formatter
55
description:
66
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
@@ -43,5 +43,5 @@ test-suite tests
4343
, base
4444
, filepath
4545
, hls-ormolu-plugin
46-
, hls-test-utils ^>=1.2
46+
, hls-test-utils ^>=1.3
4747
, lsp-types

plugins/hls-pragmas-plugin/hls-pragmas-plugin.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.4
22
name: hls-pragmas-plugin
3-
version: 1.0.2.0
3+
version: 1.0.2.1
44
synopsis: Pragmas plugin for Haskell Language Server
55
description:
66
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
@@ -46,7 +46,7 @@ test-suite tests
4646
, base
4747
, filepath
4848
, hls-pragmas-plugin
49-
, hls-test-utils ^>=1.2
49+
, hls-test-utils ^>=1.3
5050
, lens
5151
, lsp-types
5252
, text

plugins/hls-qualify-imported-names-plugin/hls-qualify-imported-names-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ test-suite tests
5151
, text
5252
, filepath
5353
, hls-qualify-imported-names-plugin
54-
, hls-test-utils ^>=1.2
54+
, hls-test-utils ^>= 1.2 || ^>=1.3

plugins/hls-rename-plugin/hls-rename-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ test-suite tests
5252
, filepath
5353
, hls-plugin-api
5454
, hls-rename-plugin
55-
, hls-test-utils ^>=1.2
55+
, hls-test-utils ^>=1.3

plugins/hls-selection-range-plugin/hls-selection-range-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ test-suite tests
5252
, containers
5353
, filepath
5454
, hls-selection-range-plugin
55-
, hls-test-utils ^>=1.2
55+
, hls-test-utils ^>=1.2 || ^>=1.3
5656
, lsp
5757
, lsp-test
5858
, text

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ test-suite tests
6464
, base
6565
, filepath
6666
, hls-splice-plugin
67-
, hls-test-utils ^>=1.2
67+
, hls-test-utils ^>=1.2 || ^>=1.3
6868
, text

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ test-suite tests
4242
, base
4343
, filepath
4444
, hls-stylish-haskell-plugin
45-
, hls-test-utils ^>=1.2
45+
, hls-test-utils ^>=1.3

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ test-suite tests
160160
, ghcide
161161
, hls-plugin-api
162162
, hls-tactics-plugin
163-
, hls-test-utils ^>=1.2
163+
, hls-test-utils ^>=1.3
164164
, hspec
165165
, hspec-expectations
166166
, lens

release/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Making and uploading the Gitlab release to downloads.haskell.org
2+
3+
1. Run the gitlab release pipeline using https://gitlab.haskell.org/haskell/haskell-language-server/-/pipelines/new
4+
2. Once the pipeline has completed, download the artifacts using `fetch_gitlab.py`
5+
- For example for the `1.7.0.0` release: `python fetch_gitlab.py -p <pipeline_id> --output haskell-language-server-1.7.0.0 -r 1.7.0.0`
6+
- Ensure all the artifacts in the output directory are accurate and add any missing/extra artifacts
7+
3. `cd` to the output directory created in the previous step, and run `SIGNING_KEY=<your signing key> ../upload.sh`

release/fetch_gitlab.py

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# adapted from https://gitlab.haskell.org/bgamari/ghc-utils/-/blob/master/rel-eng/fetch-gitlab-artifacts/fetch_gitlab.py
2+
import logging
3+
from pathlib import Path
4+
import subprocess
5+
import gitlab
6+
7+
logging.basicConfig(level=logging.INFO)
8+
9+
def strip_prefix(s, prefix):
10+
if s.startswith(prefix):
11+
return s[len(prefix):]
12+
else:
13+
return None
14+
15+
def fetch_artifacts(release: str, pipeline_id: int,
16+
dest_dir: Path, gl: gitlab.Gitlab):
17+
dest_dir.mkdir(exist_ok=True)
18+
proj = gl.projects.get('haskell/haskell-language-server')
19+
pipeline = proj.pipelines.get(pipeline_id)
20+
tmpdir = Path("fetch-gitlab")
21+
tmpdir.mkdir(exist_ok=True)
22+
for pipeline_job in pipeline.jobs.list(all=True):
23+
if len(pipeline_job.artifacts) == 0:
24+
logging.info(f'job {pipeline_job.name} ({pipeline_job.id}) has no artifacts')
25+
continue
26+
27+
job = proj.jobs.get(pipeline_job.id)
28+
platform = strip_prefix(job.name, 'tar-')
29+
if not platform:
30+
logging.info(f'Skipping {job.name} (not a tar job)')
31+
continue
32+
try:
33+
destdir = tmpdir / job.name
34+
zip_name = Path(f"{tmpdir}/{job.name}.zip")
35+
if not zip_name.exists() or zip_name.stat().st_size == 0:
36+
logging.info(f'downloading archive {zip_name} for job {job.name} (job {job.id})...')
37+
with open(zip_name, 'wb') as f:
38+
job.artifacts(streamed=True, action=f.write)
39+
40+
if zip_name.stat().st_size == 0:
41+
logging.info(f'artifact archive for job {job.name} (job {job.id}) is empty')
42+
continue
43+
44+
dest = dest_dir / f'haskell-language-server-{release}-{platform}.tar.xz'
45+
if dest.exists():
46+
logging.info(f'bindist {dest} already exists')
47+
continue
48+
49+
subprocess.run(['unzip', '-bo', zip_name, '-d', destdir])
50+
bindist_files = list(destdir.glob('*/haskell-language-server*.tar.xz'))
51+
if len(bindist_files) == 0:
52+
logging.warn(f'Bindist does not exist')
53+
continue
54+
55+
bindist = bindist_files[0]
56+
logging.info(f'extracted {job.name} to {dest}')
57+
bindist.replace(dest)
58+
except Exception as e:
59+
logging.error(f'Error fetching job {job.name}: {e}')
60+
pass
61+
62+
def main():
63+
import argparse
64+
parser = argparse.ArgumentParser()
65+
parser.add_argument('--pipeline', '-p', required=True, type=int, help="pipeline id")
66+
parser.add_argument('--release', '-r', required=True, type=str, help="release name")
67+
parser.add_argument('--output', '-o', type=Path, default=Path.cwd(), help="output directory")
68+
parser.add_argument('--profile', '-P', default='haskell',
69+
help='python-gitlab.cfg profile name')
70+
args = parser.parse_args()
71+
gl = gitlab.Gitlab.from_config(args.profile)
72+
fetch_artifacts(args.release, args.pipeline,
73+
dest_dir=args.output, gl=gl)
74+
75+
if __name__ == '__main__':
76+
main()

0 commit comments

Comments
 (0)