Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix Update GHC workflow #2258

Merged
merged 3 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/update-ghc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: Update GHC
on:
schedule:
# run weekly on Thursday
- cron: '0 15 * * THU'
- cron: '0 15 * * THU'
workflow_dispatch: # allows manual triggering

jobs:
update_ghc:
name: GHC ${{ matrix.ghc }} Update
Expand All @@ -27,7 +26,9 @@ jobs:
nix_path: nixpkgs=nixpkgs/default.nix
- name: Fetch updates
id: ghc_update
run: nix shell 'nixpkgs#bazel-buildtools' 'nixpkgs#python3' --command python .github/update-ghc.py ${{ matrix.ghc }}
run: |-
nix-shell -p 'bazel-buildtools' 'python3.withPackages (ps: [ps.packaging])' --run \
'python .github/update-ghc.py ${{ matrix.ghc }}'
- name: Create Pull Request
if: steps.ghc_update.outputs.latest != ''
uses: peter-evans/create-pull-request@v7
Expand Down
4 changes: 2 additions & 2 deletions haskell/gen_ghc_bindist.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import json
import sys
from urllib.request import urlopen
from distutils.version import StrictVersion
from packaging.version import Version

# Sometimes bindists have errors and are updated by new bindists.
# This dict is used to keep a version -> corrected_version mapping.
Expand Down Expand Up @@ -158,7 +158,7 @@ def fetch_bindists(grab):

ghc_versions = {
version: ghc_bindists[version]
for version in sorted(ghc_bindists.keys(), key=StrictVersion)
for version in sorted(ghc_bindists.keys(), key=Version)
}

json_file.truncate(0)
Expand Down