Allow users to select version of solc via kup (#105) #69
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: 'Master Push' | |
on: | |
push: | |
branches: | |
- 'master' | |
jobs: | |
nix-cache: | |
name: 'Populate Nix Cache' | |
strategy: | |
matrix: | |
runner: [normal, macos-13, ARM64] | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.push.head.sha }} | |
fetch-depth: 0 | |
- name: 'Install Nix' | |
if: ${{ matrix.runner == 'macos-13' }} | |
uses: cachix/install-nix-action@v19 | |
with: | |
install_url: https://releases.nixos.org/nix/nix-2.13.3/install | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: 'Install Cachix' | |
if: ${{ matrix.runner == 'macos-13' }} | |
uses: cachix/cachix-action@v12 | |
with: | |
name: k-framework | |
signingKey: ${{ secrets.CACHIX_SIGNING_KEY }} | |
skipPush: true | |
- name: 'Build and cache Kontrol' | |
uses: workflow/nix-shell-action@v3.0.3 | |
env: | |
GC_DONT_GC: 1 | |
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_PUBLIC_TOKEN }} | |
with: | |
packages: jq | |
script: | | |
KONTROL=$(nix build --extra-experimental-features 'nix-command flakes' .#kontrol --json | jq -r '.[].outputs | to_entries[].value') | |
DRV=$(nix-store --query --deriver ${KONTROL}) | |
nix-store --query --requisites --include-outputs ${DRV} | cachix push k-framework | |
dockerhub: | |
name: 'Build and Publish Docker Image' | |
runs-on: [self-hosted, linux, normal] | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.push.head.sha }} | |
fetch-depth: 0 | |
- name: 'Set environment' | |
run: | | |
KONTROL_VERSION=$(cat package/version) | |
TAG=runtimeverificationinc/kontrol:ubuntu-jammy-${KONTROL_VERSION} | |
echo "TAG=${TAG}" >> ${GITHUB_ENV} | |
- name: 'Build Docker image' | |
run: | | |
K_VERSION=$(cat deps/k_release) | |
docker build . --no-cache --tag ${TAG} --build-arg K_VERSION=${K_VERSION} | |
- name: 'Run Docker image' | |
run: docker run --rm ${TAG} kontrol --help | |
- name: 'Push Docker image to Docker Hub' | |
run: | | |
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login --username rvdockerhub --password-stdin | |
docker image push ${TAG} | |
cut-release: | |
name: 'Cut Release' | |
runs-on: ubuntu-latest | |
needs: dockerhub | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.push.head.sha }} | |
fetch-depth: 0 | |
- name: 'Create release' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
set -x | |
VERSION=v$(cat package/version) | |
gh release create ${VERSION} --target ${{ github.sha }} | |
- name: 'Update dependents' | |
run: | | |
set -x | |
VERSION=$(cat package/version) | |
curl --fail \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.JENKINS_GITHUB_PAT }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://github.com/repos/runtimeverification/devops/dispatches \ | |
-d '{"event_type":"on-demand-test","client_payload":{"repo":"runtimeverification/kontrol","version":"'${VERSION}'"}}' | |