Push Kontrol w/ Dependencies #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: 'Push Kontrol w/ Dependencies' | |
on: | |
workflow_dispatch: | |
inputs: | |
kevm-version: | |
description: 'Branch/Tag to use for KEVM' | |
required: false | |
default: '' | |
k-version: | |
description: 'Branch/Tag to use for K' | |
required: false | |
default: '' | |
llvm-version: | |
description: 'Branch/Tag to use for LLVM Backend' | |
required: false | |
default: '' | |
haskell-version: | |
description: 'Branch/Tag to use for Haskell Backend' | |
required: false | |
default: '' | |
jobs: | |
build-kontrol: | |
runs-on: [self-hosted, normal] | |
steps: | |
- name: 'Login to GitHub Container Registry' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Build Kontrol' | |
shell: bash | |
run: | | |
set -o pipefail | |
docker run --rm -it --detach --name kontrol-build-with-kup-${{ github.run_id }} ghcr.io/runtimeverification/kup:latest | |
if [ -n "${{ inputs.kevm-version }}" ]; then | |
KEVM_OVERRIDE="--override kevm ${{ inputs.kevm-version }}" | |
fi | |
if [ -n "${{ inputs.k-version }}" ]; then | |
K_OVERRIDE="--override kevm/k-framework ${{ inputs.k-version }}" | |
fi | |
if [ -n "${{ inputs.llvm-version }}" ]; then | |
LLVM_OVERRIDE="--override kevm/k-framework/llvm-backend ${{ inputs.llvm-version }}" | |
fi | |
if [ -n "${{ inputs.haskell-version }}" ]; then | |
HASKELL_OVERRIDE="--override kevm/k-framework/haskell-backend ${{ inputs.haskell-version }}" | |
fi | |
docker exec kontrol-build-with-kup-${{ github.run_id }} /bin/bash -c "kup install kontrol ${KEVM_OVERRIDE} ${K_OVERRIDE} ${LLVM_OVERRIDE} ${HASKELL_OVERRIDE}" | |
docker exec kontrol-build-with-kup-${{ github.run_id }} /bin/bash -c "kup list kontrol --inputs" >> versions.out | |
docker commit kontrol-build-with-kup-${{ github.run_id }} ghcr.io/runtimeverification/kontrol-custom:${{ github.run_id }} | |
docker push ghcr.io/runtimeverification/kontrol-custom:${{ github.run_id }} | |
- name: 'Publish Versions to Artifacts' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Versions | |
path: versions.out | |
- name: 'Publish Image Name to Workflow Summary' | |
run: | | |
echo "Image Name: ghcr.io/runtimeverification/kontrol-custom:${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY | |
- name: 'Tear down Docker' | |
if: always() | |
run: | | |
docker stop --time=0 kontrol-build-with-kup-${{ github.run_id }} |