Create GitHub Action, and clean up. (#44)

* Update hello.yml

* Delete action.yaml

* Delete fetch-docker.sh

* Delete devx

---------

Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
This commit is contained in:
Hamish Mackenzie 2023-04-27 23:40:05 +12:00 committed by GitHub
parent 85be4e0361
commit a4b85959e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 48 deletions

View File

@ -28,12 +28,12 @@ jobs:
- "-js"
# Comming soon.
#- "-windows"
variant:
- ""
- "-minimal"
minimal:
- false
- true
iog:
- ""
- "-iog"
- false
- true
exclude:
# Just cross compiling javascript with ghc 9.6.1 for now
- compiler-nix-name: ghc8107
@ -45,10 +45,10 @@ jobs:
target-platform: "-static"
# Static tools not working right now (so just building "-static-minimal" for now)
- target-platform: "-static"
variant: ""
minimal: false
# hlint and hls not working on ghc 9.6.1 yet
- target-platform: ghc961
variant: ""
minimal: false
# Windows cross compilation only works on x86_64 right now.
- platform: aarch64-darwin
target-platform: "-windows"
@ -59,24 +59,14 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Nix with good defaults
uses: cachix/install-nix-action@v17
- name: Install GHC and Cabal
uses: input-output-hk/actions/devx@latest
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://cache.iog.io/ https://cache.zw3rk.com/ https://cache.nixos.org/
nix_path: nixpkgs=channel:nixos-unstable
- name: Install jq
shell: bash
run: |
curl -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -o jq
chmod +x jq
- name: Download and import closure
shell: bash
run: |
./fetch-docker.sh input-output-hk/devx ${{ matrix.platform }}.${{ matrix.compiler-nix-name }}${{ matrix.target-platform }}${{ matrix.variant }}${{ matrix.iog }}-env | zstd -d | nix-store --import | tee store-paths.txt
sudo ln -s $(tail -n 1 store-paths.txt) /usr/local/bin/devx-env.sh
sudo cp extra/devx /usr/local/bin
platform: ${{ matrix.platform }}
target-platform: ${{ matrix.target-platform }}
compiler-nix-name: ${{ matrix.compiler-nix-name }}
minimal: ${{ matrix.minimal }}
iog: ${{ matrix.iog }}
- name: cabal update
run: cabal update
- name: unapck hello

View File

@ -1,6 +0,0 @@
#!/bin/bash
set -euo pipefail
source /usr/local/bin/devx-env.sh
source "$1"

View File

@ -1,18 +0,0 @@
#!/bin/bash
TOKEN=$(curl --silent https://ghcr.io/token\?scope\=repository:$1:pull | jq -r .token)
BLOB=$(curl \
--silent \
--request 'GET' \
--header "Authorization: Bearer $TOKEN" \
--header "Accept: application/vnd.docker.distribution.manifest.list.v2+json" \
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
"https://ghcr.io/v2/$1/manifests/$2" | tee manifest.json | jq -r '.layers[0].digest')
curl \
--location \
--request GET \
--header "Authorization: Bearer ${TOKEN}" \
"https://ghcr.io/v2/$1/blobs/${BLOB}"