From d1075987de1b8208bf4581bfd07c04e5f2b53f03 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 2 Jan 2023 19:59:43 +0800 Subject: [PATCH] Fix ARM cleanup --- .github/scripts/common.sh | 37 +++++++++++++--------------------- .github/workflows/release.yaml | 8 ++++---- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/.github/scripts/common.sh b/.github/scripts/common.sh index 7fe2688..d42830d 100644 --- a/.github/scripts/common.sh +++ b/.github/scripts/common.sh @@ -87,39 +87,29 @@ download_cabal_cache() { cd /tmp case "${RUNNER_OS}" in "Linux") - case "${DISTRO}" in - "Alpine") - case "${ARCH}" in - "32") url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/1.0.5.1/i386-linux-alpine-cabal-cache-1.0.5.1 - ;; - "64") url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/1.0.5.1/x86_64-linux-alpine-cabal-cache-1.0.5.1 - ;; - esac + case "${ARCH}" in + "32") url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/experimental4/i386-linux-cabal-cache ;; - *) - case "${ARCH}" in - "64") url=https://github.com/haskell-works/cabal-cache/releases/download/v1.0.5.1/cabal-cache-x86_64-linux.gz - ;; - "ARM64") url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/1.0.5.1/aarch64-linux-cabal-cache-1.0.5.1 - ;; - "ARM") url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/1.0.5.1/armv7-linux-cabal-cache-1.0.5.1 - ;; - esac + "64") url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/experimental4/x86_64-linux-cabal-cache + ;; + "ARM64") url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/experimental4/aarch64-linux-cabal-cache + ;; + "ARM") url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/experimental4/armv7-linux-cabal-cache ;; esac ;; "FreeBSD") - url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/1.0.5.1/x86_64-freebsd-cabal-cache-1.0.5.1 + url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/experimental4/x86_64-portbld-freebsd-cabal-cache ;; "Windows") exe=".exe" - url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/1.0.5.1/x86_64-mingw64-cabal-cache-1.0.5.1.exe + url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/experimental4/x86_64-mingw64-cabal-cache ;; "macOS") case "${ARCH}" in - "ARM64") url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/1.0.5.1/aarch64-apple-darwin-cabal-cache-1.0.5.1 + "ARM64") url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/experimental4/aarch64-apple-darwin-cabal-cache ;; - "64") url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/1.0.5.1/x86_64-apple-darwin-cabal-cache-1.0.5.1 + "64") url=https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal-cache/experimental4/x86_64-apple-darwin-cabal-cache ;; esac ;; @@ -134,8 +124,9 @@ download_cabal_cache() { curl -o cabal-cache${exe} -L "${url}" ;; esac - chmod +x cabal-cache${exe} - cp "cabal-cache${exe}" "${dest}${exe}" + sha_sum cabal-cache${exe} + mv "cabal-cache${exe}" "${dest}${exe}" + chmod +x "${dest}${exe}" fi ) } diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index de5779f..111a169 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -102,7 +102,7 @@ jobs: - uses: docker://arm64v8/ubuntu:focal name: Cleanup (aarch64 linux) with: - args: rm -rf .ghcup/ cabal/ dist-newstyle/ out/ + args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +" - name: git config run: | @@ -297,7 +297,7 @@ jobs: - uses: docker://arm64v8/ubuntu:focal name: Cleanup (aarch64 linux) with: - args: rm -rf .ghcup/ cabal/ dist-newstyle/ out/ + args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +" - name: Checkout code uses: actions/checkout@v3 @@ -313,7 +313,7 @@ jobs: uses: docker://hasufell/arm32v7-ubuntu-haskell:focal name: Run build (armv7 linux) with: - run: sh .github/scripts/test.sh + args: sh .github/scripts/test.sh env: ARTIFACT: ${{ matrix.ARTIFACT }} ARCH: ${{ matrix.ARCH }} @@ -324,7 +324,7 @@ jobs: uses: docker://hasufell/arm64v8-ubuntu-haskell:focal name: Run build (aarch64 linux) with: - run: sh .github/scripts/test.sh + args: sh .github/scripts/test.sh env: ARTIFACT: ${{ matrix.ARTIFACT }} ARCH: ${{ matrix.ARCH }}