Set Version: 1.0.16 #92
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: 'Release' | |
on: | |
push: | |
branches: | |
- 'release' | |
jobs: | |
draft-release: | |
name: 'Draft Release' | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.make-release.outputs.version }} | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v4 | |
- name: 'Make release' | |
id: 'make-release' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
set -x | |
VERSION=v$(cat package/version) | |
gh release create "${VERSION}" \ | |
--repo runtimeverification/kontrol \ | |
--draft \ | |
--title ${VERSION} \ | |
--target ${{ github.sha }} | |
echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
nix-cache: | |
name: 'Populate Nix Cache' | |
strategy: | |
matrix: | |
runner: [normal, MacIntel, ARM64] | |
runs-on: ${{ matrix.runner }} | |
needs: draft-release | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.push.head.sha }} | |
fetch-depth: 0 | |
- name: 'Build and cache Kontrol' | |
uses: workflow/nix-shell-action@v3 | |
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 | |
- name: 'On failure, delete drafted release' | |
if: failure() | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
set -x | |
VERSION=v$(cat package/version) | |
gh release delete ${VERSION} \ | |
--repo runtimeverification/kontrol \ | |
--yes \ | |
--cleanup-tag | |
nix-binary-cache: | |
name: 'Populate Nix Binary Cache' | |
strategy: | |
matrix: | |
runner: [normal, MacIntel, ARM64] | |
runs-on: ${{ matrix.runner }} | |
needs: draft-release | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v4 | |
- name: 'Publish Kontrol to k-framework-binary cache' | |
uses: workflow/nix-shell-action@v3 | |
env: | |
CACHIX_AUTH_TOKEN: '${{ secrets.CACHIX_PRIVATE_KFB_TOKEN }}' | |
GC_DONT_GC: '1' | |
with: | |
packages: jq | |
script: | | |
export PATH="$(nix build github:runtimeverification/kup --no-link --json | jq -r '.[].outputs | to_entries[].value')/bin:$PATH" | |
kup publish k-framework-binary .#kontrol --keep-days 180 | |
kup publish k-framework-binary .#kontrol.solc_0_8_13 --keep-days 180 | |
kup publish k-framework-binary .#kontrol.solc_0_8_15 --keep-days 180 | |
- name: 'On failure, delete drafted release' | |
if: failure() | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
set -x | |
VERSION=v$(cat package/version) | |
gh release delete ${VERSION} \ | |
--repo runtimeverification/kontrol \ | |
--yes \ | |
--cleanup-tag | |
dockerhub: | |
name: 'Build and Publish Docker Image' | |
runs-on: [self-hosted, linux, normal] | |
needs: draft-release | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v4 | |
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) | |
Z3_VERSION=$(cat deps/z3) | |
docker build . --no-cache --tag ${TAG} --build-arg K_VERSION=${K_VERSION} --build-arg Z3_VERSION=${Z3_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} | |
- name: 'On failure, delete drafted release' | |
if: failure() | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
set -x | |
VERSION=v$(cat package/version) | |
gh release delete ${VERSION} \ | |
--repo runtimeverification/kontrol \ | |
--yes \ | |
--cleanup-tag | |
cut-release: | |
name: 'Cut Release' | |
runs-on: ubuntu-latest | |
needs: [dockerhub, nix-cache, nix-binary-cache] | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.push.head.sha }} | |
fetch-depth: 0 | |
- name: 'Finalize Release' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
set -x | |
VERSION=v$(cat package/version) | |
gh release edit ${VERSION} \ | |
--repo runtimeverification/kontrol \ | |
--draft=false | |
- 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://api.github.com/repos/runtimeverification/devops/dispatches \ | |
-d '{"event_type":"on-demand-test","client_payload":{"repo":"runtimeverification/kontrol","version":"'${VERSION}'"}}' |