diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 69457d6..2c36d96 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,6 +3,8 @@ name: Build on: pull_request: push: + tags: + - '*' branches: - master @@ -13,8 +15,6 @@ jobs: steps: - name: Clone project uses: actions/checkout@v2 - with: - submodules: "true" - uses: extractions/setup-just@v1 with: just-version: 1.8.0 @@ -24,7 +24,7 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - uses: cachix/install-nix-action@v19 + - uses: cachix/install-nix-action@v22 with: nix_path: nixpkgs=channel:nixos-unstable - name: Build images @@ -37,9 +37,14 @@ jobs: - name: Test image shell: bash run: just test-image - - name: Release + - name: Push image if: startsWith(github.ref, 'refs/tags/') shell: bash run: | set -exuo pipefail just push-image + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + generate_release_notes: true diff --git a/Dockerfile b/Dockerfile index 3861c95..59d4a8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ RUN apk upgrade --no-cache &&\ lld \ shadow # for stack --docker, provides groupadd -RUN curl -sSLo /usr/local/bin/stack https://github.com/commercialhaskell/stack/releases/download/v2.9.3/stack-2.9.3-linux-x86_64-bin && \ +RUN curl -sSLo /usr/local/bin/stack https://github.com/commercialhaskell/stack/releases/download/v2.11.1/stack-2.11.1-linux-x86_64-bin && \ chmod +x /usr/local/bin/stack # https://stackoverflow.com/a/41517423 diff --git a/README.md b/README.md index f8b14f4..8a3cdda 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ The images here are used to build the static binary for the Haskell's stack buil with proper location of include headers and library files to make the build working. -If you have to update the image for newer GHC, you have to update these things: +If you have to update the image for newer GHC, you have to update +these things: - The nixpkgs commit which has the specific GHC you want. Update the [ghc-musl.nix](./ghc-musl.nix) with the appropriate commit. @@ -27,6 +28,15 @@ If you have to update the image for newer GHC, you have to update these things: alpine image as the base image. - Update the [justfile](./justfile) with the new GHC tag. - Update the stack version in the [Dockerfile](./Dockerfile). +- Create a PR to this repository. Once it's merged, create a tag and + it will push the image to ghcr.io + +For upgrading the base alpine images, these are the steps: + +- Get alpine image's SHA digest from [dockerhub](https://hub.docker.com/_/alpine/) and replace it in + ghc-musl.nix's imageDigest. +- Upgrade the sha256 based on the CI error message or use [skopeo](https://nixos.wiki/wiki/Docker#How_to_calculate_the_sha256_of_a_pulled_image) + to calcuate the hash. # Building images @@ -59,3 +69,6 @@ Version 2.9.3, Git revision 6cf638947a863f49857f9cfbf72a38a48b183e7e x86_64 hpac * [GHC 8.10.4](https://hub.docker.com/layers/fpco/alpine-haskell-stack/8.10.4/images/sha256-ff56997dc0cd1f859a342b6c4b0f069600e21574c9371657817ce8738c8461af?context=repo) * [GHC 8.8.3](https://hub.docker.com/layers/fpco/alpine-haskell-stack/gmp-ghc-8.8.3/images/sha256-bf1050a24b0a9d309ec98418e578ddce474dd60542da8f9367f36e4ed6498e8e?context=repo) * [GHC 8.6.5](https://hub.docker.com/layers/fpco/alpine-haskell-stack/8.6.5/images/sha256-49e7e15f3b1d3f882ba5bb701463b1d508fbf40e5aafce6ea31acd210da570ba?context=explore) + +Recent images are built using Github actions and uploaded to [github +container registry](https://github.com/orgs/fpco/packages?repo_name=alpine-haskell-stack). diff --git a/ghc-musl.nix b/ghc-musl.nix index 33055e3..e9cb714 100644 --- a/ghc-musl.nix +++ b/ghc-musl.nix @@ -1,7 +1,7 @@ { pkgs ? import (builtins.fetchTarball { url = - "https://github.com/NixOS/nixpkgs/archive/81d5cb1550ef0a58c5ee529c743065cc93a7fb64.tar.gz"; + "https://github.com/NixOS/nixpkgs/archive/989a2b93b79dd0553028e83be5f5db7221476d76.tar.gz"; }) { } }: @@ -9,8 +9,8 @@ let alpineImage = pkgs.dockerTools.pullImage { imageName = "alpine"; imageDigest = - "sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501"; - sha256 = "sha256-YCYpUByIOig4zt/WIvDas3AwHjDYkIQJ6IEKuADJmgg="; + "sha256:25fad2a32ad1f6f510e528448ae1ec69a28ef81916a004d3629874104f8a7f70"; + sha256 = "sha256-ymburWdn08/l5jqTAmdeXbBys0q01OmNuOVG4mnMzqk="; }; in pkgs.dockerTools.buildImage { @@ -20,7 +20,7 @@ pkgs.dockerTools.buildImage { fromImage = alpineImage; contents = [ - pkgs.pkgsMusl.haskell.compiler.ghc927 + pkgs.pkgsMusl.haskell.compiler.ghc945 pkgs.pkgsMusl.zlib pkgs.pkgsMusl.zlib.dev pkgs.pkgsMusl.ncurses diff --git a/justfile b/justfile index b3cfc32..6f7f863 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,4 @@ -GHC_VERSION := "9.2.7" +GHC_VERSION := "9.4.5" # List all recipies default: