Skip to content

Commit

Permalink
Merge pull request #2258 from tweag/cb/fix-ghc-update
Browse files Browse the repository at this point in the history
Fix Update GHC workflow
  • Loading branch information
mergify[bot] authored Nov 18, 2024
2 parents 2d5301f + 82a5e74 commit 20b8a65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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

0 comments on commit 20b8a65

Please sign in to comment.