Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
64 changes: 64 additions & 0 deletions .github/workflows/ghc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: "GHC images"

on:
# FIXME: Remove this before merging!
# pull_request: { branches: [ "master" ] }
# push: { branches: [ "release" ] }

env:
alpine_ver: "3.14"

jobs:
build:
runs-on: "ubuntu-20.04"

strategy:
matrix:
ghc_ver: [ "8.10.7" ]
numeric: [ "gmp" ]

steps:
- name: "Check this repository out."
uses: "actions/checkout@v2"

- name: "Pull `ghcup` image."
run: |
# TODO: Avoid having to specify a ghcup version here...
buildah pull docker://ghcr.io/jkachmar/ghcup:0.1.17.2

- name: "Compile GHC and publish an image from the resulting container."
id: "build-image"
run: |
image_id=$(
./ghc/builder.sh \
-a "${{ env.alpine_ver }}" \
-g "${{ matrix.ghc_ver }}" \
-n "${{ matrix.numeric }}" \
| tail -n 1
)

image_name=$(
buildah images --format "{{.Name}}" ${image_id}
)
# NOTE: This parameter expansion drops the leading `localhost/` that
# `buildah` (and other OCI tools) prepend to local image names.
echo "::set-output name=image_name::${image_name#*/}"

image_tags=$(
buildah images --format "{{.Tag}}" ${image_id}
)
echo "::set-output name=image_tags::${image_tags}"

- name: "Push compiled GHC image to the GitHub Container Registry."
id: "push-to-ghcr"
uses: "redhat-actions/push-to-registry@v2"
with:
image: "${{ steps.build-image.outputs.image_name }}"
tags: "${{ steps.build-image.outputs.image_tags }}"
registry: "ghcr.io/${{ github.repository_owner }}"
username: "${{ github.actor }}"
password: "${{ github.token }}"

- name: "Print image URL."
run: |
echo "Image pushed to ${{ steps.push-to-ghcr.outputs.registry-paths }}"
54 changes: 54 additions & 0 deletions .github/workflows/ghcup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "`ghcup` image"

# FIXME: Re-enable this workflow before merging!
on:
# FIXME: Remove this before merging!
# pull_request: { branches: [ "master" ] }
# push: { branches: [ "release" ] }

env:
alpine_ver: "3.14"

jobs:
build:
runs-on: "ubuntu-20.04"

steps:
- name: "Check this repository out."
uses: "actions/checkout@v2"

- name: "Download `ghcup` and publish an image containing it."
id: "build-image"
run: |
image_id=$(
./ghcup/builder.sh \
-a "${{ env.alpine_ver }}" \
| tail -n 1
)
echo "::set-output name=image_id::${image_id}"

image_name=$(
buildah images --format "{{.Name}}" ${image_id}
)
# NOTE: This parameter expansion drops the leading `localhost/` that
# `buildah` (and other OCI tools) prepend to local image names.
echo "::set-output name=image_name::${image_name#*/}"

image_tags=$(
buildah images --format "{{.Tag}}" ${image_id}
)
echo "::set-output name=image_tags::${image_tags}"

- name: "Push `ghcup` image to the GitHub Container Registry"
id: "push-to-ghcr"
uses: "redhat-actions/push-to-registry@v2"
with:
image: "${{ steps.build-image.outputs.image_name }}"
tags: "${{ steps.build-image.outputs.image_tags }}"
registry: "ghcr.io/${{ github.repository_owner }}"
username: "${{ github.actor }}"
password: "${{ github.token }}"

- name: "Print image URL."
run: |
echo "Image pushed to ${{ steps.push-to-ghcr.outputs.registry-paths }}"
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.stack-work
# JetBrains' IDEs
.idea
.direnv
.tmp
authfile.json
secrets
134 changes: 0 additions & 134 deletions Dockerfile

This file was deleted.

Loading