Overhaul metadata merging and add 'ghcup config add-release-channel URI'
Wrt #328 (closed) @abel
This PR does two things:
- makes merging release channels more robust (previously we would only merge versions if the tool exists in the main channel)
- adds cli support, so to get pre-releases you would do:
ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml
This might make adding pre-releases easier as described in #328 (comment 414294)
So a github workflow would look as follows:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
ghc: ['8.10.7', '9.3.2.20220308']
cabal: ['3.6.2.0']
steps:
- uses: actions/checkout@v2
- name: enable pre-releases
run: ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml
shell: bash
- uses: haskell/actions/setup@v1.2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
Obviously, this will only work for windows if https://github.com/haskell/actions/issues/70 is merged. But since ghcup
is pre-installed on ALL github environments, you can simply drop haskell/actions/setup@v1.2
and do this instead:
- name: Install ghc/cabal
run: |
ghcup install ghc --set ${{ matrix.ghc }}
ghcup install cabal ${{ matrix.cabal }}
Edited by Julian Ospald