ci: binaries-mac: switch to ghcup for setup, like linux

This commit is contained in:
Simon Michael 2024-04-17 13:18:18 -10:00
parent 5c36a297dc
commit 82cc77f184
2 changed files with 25 additions and 35 deletions

View File

@ -115,17 +115,19 @@ jobs:
${{ runner.os }}-hledger-web-stack-work-from20220817 ${{ runner.os }}-hledger-web-stack-work-from20220817
if: env.CONTINUE if: env.CONTINUE
# actions: - name: Add .ghcup/bin to PATH for following steps
- name: Install stack
# run: |
# brew install haskell-stack
# $stack --version
run: | run: |
mkdir -p ~/.local/bin echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH
export PATH=~/.local/bin:$PATH
# brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-arm64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack - name: Install stack with ghcup if needed
if [[ ! -x ~/.local/bin/stack ]]; then brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-arm64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi run: |
if [[ ! -x ~/.ghcup/bin/ghcup ]]; then
mkdir -p ~/.ghcup/bin && curl https://downloads.haskell.org/~ghcup/aarch64-apple-darwin-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup
fi
ghcup --version
if [[ ! -x ~/.ghcup/bin/stack ]]; then
~/.ghcup/bin/ghcup install stack 2.15.5 && ~/.ghcup/bin/ghcup set stack 2.15.5
fi
stack --version stack --version
if: env.CONTINUE if: env.CONTINUE
@ -143,13 +145,6 @@ jobs:
# echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH # echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH
# if: env.CONTINUE # if: env.CONTINUE
# - name: Install GHC (from haskell.org)
# run: |
# curl -sL https://downloads.haskell.org/~ghc/9.2.4/ghc-9.2.4-arm64-apple-darwin.tar.xz | tar xj && cd ghc-9.2.4-arm64-apple-darwin && ./configure && make install
# ghc --version
# mkdir -p ~/.stack && printf "system-ghc: true\ninstall-ghc: false\n" >>~/.stack/config.yaml
# if: env.CONTINUE
- name: Install haskell deps - name: Install haskell deps
env: env:
stack: ${{ matrix.plan.stack }} stack: ${{ matrix.plan.stack }}

View File

@ -115,21 +115,23 @@ jobs:
${{ runner.os }}-hledger-web-stack-work-from20220817 ${{ runner.os }}-hledger-web-stack-work-from20220817
if: env.CONTINUE if: env.CONTINUE
# actions: - name: Add .ghcup/bin to PATH for following steps
- name: Install stack
# run: |
# brew install haskell-stack
# $stack --version
run: | run: |
mkdir -p ~/.local/bin echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH
export PATH=~/.local/bin:$PATH
# brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack - name: Install stack with ghcup if needed
if [[ ! -x ~/.local/bin/stack ]]; then brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi run: |
if [[ ! -x ~/.ghcup/bin/ghcup ]]; then
mkdir -p ~/.ghcup/bin && curl https://downloads.haskell.org/~ghcup/x86_64-apple-darwin-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup
fi
ghcup --version
if [[ ! -x ~/.ghcup/bin/stack ]]; then
~/.ghcup/bin/ghcup install stack 2.15.5 && ~/.ghcup/bin/ghcup set stack 2.15.5
fi
stack --version stack --version
if: env.CONTINUE if: env.CONTINUE
- name: Install GHC (with stack) - name: Install GHC with stack
env: env:
stack: ${{ matrix.plan.stack }} stack: ${{ matrix.plan.stack }}
run: | run: |
@ -143,13 +145,6 @@ jobs:
# echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH # echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH
# if: env.CONTINUE # if: env.CONTINUE
# - name: Install GHC (from haskell.org)
# run: |
# curl -sL https://downloads.haskell.org/~ghc/9.2.4/ghc-9.2.4-x86_64-apple-darwin.tar.xz | tar xj && cd ghc-9.2.4-x86_64-apple-darwin && ./configure && make install
# ghc --version
# mkdir -p ~/.stack && printf "system-ghc: true\ninstall-ghc: false\n" >>~/.stack/config.yaml
# if: env.CONTINUE
- name: Install haskell deps - name: Install haskell deps
env: env:
stack: ${{ matrix.plan.stack }} stack: ${{ matrix.plan.stack }}