summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2023-05-17 18:14:17 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2023-05-17 18:14:17 +0100
commit99bccf6595a0085758e54f869fdf2137cc8cb532 (patch)
treedf6918d09829b1da4ab0982a4b986aada03c28ea
parent7c89fb19764b2fb153365d8f4fcb69e27fe2ce72 (diff)
downloadhaskell-99bccf6595a0085758e54f869fdf2137cc8cb532.tar.gz
ghcup-metadata: More support for nightlies
-rw-r--r--.gitlab-ci.yml6
-rw-r--r--.gitlab/rel_eng/mk-ghcup-metadata/README.mkd1
-rwxr-xr-x.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py6
3 files changed, 8 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d57ee0a2c0..d5b1097e2e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1000,7 +1000,7 @@ project-version:
# Download existing ghcup metadata for the correct year
- PipelineYear="$(date -d $CI_PIPELINE_CREATED_AT +%Y)"
- - nix shell nixpkgs#wget -c wget "https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-$PipelineYear-0.0.7.yaml"
+ - nix shell nixpkgs#wget -c wget "https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-$PipelineYear-0.0.7.yaml" -O ghcup-0.0.7.yaml
- .gitlab/generate_job_metadata
@@ -1045,7 +1045,7 @@ ghcup-metadata-nightly:
artifacts: false
- job: project-version
script:
- - nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" > "metadata_test.yaml"
+ - nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="$(date -d $CI_PIPELINE_CREATED_AT +%Y-%M-%d)" --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" > "metadata_test.yaml"
rules:
- if: $NIGHTLY
@@ -1082,7 +1082,7 @@ ghcup-metadata-release:
# No explicit needs for release pipeline as we assume we need everything and everything will pass.
extends: .ghcup-metadata
script:
- - nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --release-mode --metadata ghcup-0.0.7.yaml --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" > "metadata_test.yaml"
+ - nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --release-mode --metadata ghcup-0.0.7.yaml --date="$(date -d $CI_PIPELINE_CREATED_AT +%Y-%M-%d)" --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" > "metadata_test.yaml"
rules:
- if: '$RELEASE_JOB == "yes"'
diff --git a/.gitlab/rel_eng/mk-ghcup-metadata/README.mkd b/.gitlab/rel_eng/mk-ghcup-metadata/README.mkd
index fe16439b61..ef72935ff3 100644
--- a/.gitlab/rel_eng/mk-ghcup-metadata/README.mkd
+++ b/.gitlab/rel_eng/mk-ghcup-metadata/README.mkd
@@ -18,6 +18,7 @@ options:
--release-mode Generate metadata which points to downloads folder
--fragment Output the generated fragment rather than whole modified file
--version VERSION Version of the GHC compiler
+ --date DATE Date of the compiler release
```
The script also requires the `.gitlab/jobs-metadata.yaml` file which can be generated
diff --git a/.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py b/.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
index 437712fb41..ddfab76dcf 100755
--- a/.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
+++ b/.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
@@ -158,7 +158,7 @@ def mk_from_platform(pipeline_type, platform):
return Artifact(info['name'] , f"{info['jobInfo']['bindistName']}.tar.xz", platform.subdir)
# Generate the new metadata for a specific GHC mode etc
-def mk_new_yaml(release_mode, version, pipeline_type, job_map):
+def mk_new_yaml(release_mode, version, date, pipeline_type, job_map):
def mk(platform):
eprint("\n=== " + platform.name + " " + ('=' * (75 - len(platform.name))))
return mk_one_metadata(release_mode, version, job_map, mk_from_platform(pipeline_type, platform))
@@ -234,6 +234,7 @@ def mk_new_yaml(release_mode, version, pipeline_type, job_map):
return { "viTags": ["Latest", "TODO_base_version"]
+ , "viReleaseDay": date
# Check that this link exists
, "viChangeLog": change_log
, "viSourceDL": source
@@ -264,6 +265,7 @@ def main() -> None:
parser.add_argument('--fragment', action='store_true', help='Output the generated fragment rather than whole modified file')
# TODO: We could work out the --version from the project-version CI job.
parser.add_argument('--version', required=True, type=str, help='Version of the GHC compiler')
+ parser.add_argument('--date', required=True, type=str, help='Date of the compiler release')
args = parser.parse_args()
project = gl.projects.get(1, lazy=True)
@@ -284,7 +286,7 @@ def main() -> None:
eprint(f"Pipeline Type: {pipeline_type}")
- new_yaml = mk_new_yaml(args.release_mode, args.version, pipeline_type, job_map)
+ new_yaml = mk_new_yaml(args.release_mode, args.version, args.date, pipeline_type, job_map)
if args.fragment:
print(yaml.dump({ args.version : new_yaml }))