Skip to content

Commit

Permalink
feat: ability to specify all release channels
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabedini committed Dec 12, 2024
1 parent 845f2ba commit 497af3c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 8 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/test-ghcup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:

jobs:
build:
simple:
strategy:
matrix:
runs-on:
Expand Down Expand Up @@ -47,3 +47,30 @@ jobs:
- run: ghcup whereis hls latest
- run: which haskell-language-server-wrapper
- run: haskell-language-server-wrapper --version

vanilla_channel:
strategy:
matrix:
runs-on:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4

- uses: ./ghcup
with:
release-channels: |
GHCupURL
https://raw.githubusercontent.com/haskell/ghcup-metadata/refs/heads/develop/ghcup-vanilla-0.0.8.yaml
- run: ghcup config
- run: ghcup debug-info
- run: ghcup tool-requirements
- run: ghcup list

- run: ghcup install ghc latest --set
- run: ghcup whereis ghc latest
- run: which ghc
- run: ghc --version
4 changes: 3 additions & 1 deletion ghcup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ inputs:
version:
description: Version to install
default: latest
extra-release-channels:
release-channels:
description: Additional release-channels
default: |
GHCupURL
outputs:
path:
Expand Down
2 changes: 1 addition & 1 deletion ghcup/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ghcup/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import core from "@actions/core";
try {
main({
version: core.getInput("version"),
extra_release_channels: core.getMultilineInput("extra-release-channels")
release_channels: core.getMultilineInput("release-channels")
})
} catch (error) {
core.setFailed((error as Error).message);
Expand Down
8 changes: 4 additions & 4 deletions ghcup/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function ghcup(version: string) {

export type Opts = {
version: string,
extra_release_channels: string[]
release_channels: string[]
}

export async function main(opts: Opts) {
Expand All @@ -87,7 +87,7 @@ export async function main(opts: Opts) {
core.debug(`ghcup bindir is ${bindir}`)
core.addPath(bindir);

for (const channel in opts.extra_release_channels) {
await exec.exec(ghcupPath, ['config', 'add-release-channel', channel]);
}
await exec.exec(ghcupPath, [
'config', 'set', 'url-source', `'${JSON.stringify(opts.release_channels)}'`
]);
}

0 comments on commit 497af3c

Please sign in to comment.