Skip to content

K Framework Release v6.0.85 #829

K Framework Release v6.0.85

K Framework Release v6.0.85 #829

Workflow file for this run

name: 'Release'
run-name: K Framework Release ${{ github.ref_name }}
on:
release:
types:
- prereleased
concurrency:
group: ${{ github.workflow }}
jobs:
set-release-id:
name: 'Set Release ID'
runs-on: ubuntu-20.04
steps:
- name: 'Get release_id'
run: echo "release_id=$(jq --raw-output '.release.id' $GITHUB_EVENT_PATH)" >> ${GITHUB_OUTPUT}
id: release
outputs:
release_id: ${{ steps.release.outputs.release_id }}
source-tarball:
name: 'Create source tarball'
runs-on: ubuntu-latest
environment: production
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
- name: 'Create source tarball'
env:
GITHUB_TOKEN: ${{ secrets.JENKINS_GITHUB_PAT }}
run: |
set -x
version=$(cat package/version)
tarball=kframework-${version}-src.tar.gz
find . -name .git | xargs rm -r
CURDIR=$(pwd)
cd ..
tar czvf ${tarball} $(basename ${CURDIR})
mv ${tarball} ${CURDIR}/
cd ${CURDIR}
gh release upload --repo runtimeverification/k --clobber v${version} ${tarball}
nix-release:
name: 'Nix Release'
runs-on: ubuntu-20.04
environment: production
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = http://cache.nixos.org https://hydra.iohk.io
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
- name: Upload release.nix
uses: ttuegel/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
ubuntu-jammy:
name: 'K Ubuntu Jammy Package'
runs-on: [self-hosted, linux, normal]
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
- name: 'Build and Test Package'
uses: ./.github/actions/test-package
with:
os: ubuntu
distro: jammy
llvm: 14
pkg-name: kframework_amd64_ubuntu_jammy.deb
build-package: package/debian/build-package jammy
test-package: package/debian/test-package
- name: 'Upload Package to Release'
env:
GITHUB_TOKEN: ${{ secrets.JENKINS_GITHUB_PAT }}
run: |
set -x
version=$(cat package/version)
cp kframework_amd64_ubuntu_jammy.deb kframework_${version}_amd64_ubuntu_jammy.deb
gh release upload --repo runtimeverification/k --clobber v${version} kframework_${version}_amd64_ubuntu_jammy.deb
- name: 'Build, Test, and Push Dockerhub Image'
shell: bash {0}
env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPO: runtimeverificationinc/kframework-k
run: |
set -euxo pipefail
version=$(cat package/version)
version_tag=ubuntu-jammy-${version}
docker login --username rvdockerhub --password ${DOCKERHUB_PASSWORD}
docker image build . --file package/docker/Dockerfile.ubuntu-jammy --tag ${DOCKERHUB_REPO}:${version_tag}
docker run --name k-package-docker-test-jammy-${GITHUB_SHA} --rm -it --detach ${DOCKERHUB_REPO}:${version_tag}
docker exec -t k-package-docker-test-jammy-${GITHUB_SHA} bash -c 'cd ~ && echo "module TEST imports BOOL endmodule" > test.k'
docker exec -t k-package-docker-test-jammy-${GITHUB_SHA} bash -c 'cd ~ && kompile test.k --backend llvm'
docker exec -t k-package-docker-test-jammy-${GITHUB_SHA} bash -c 'cd ~ && kompile test.k --backend haskell'
docker image push ${DOCKERHUB_REPO}:${version_tag}
- name: 'Clean up Docker Container'
if: always()
run: |
docker stop --time=0 k-package-docker-test-jammy-${GITHUB_SHA}
- name: On Failure, Upload the kore-exec.tar.gz file to the Summary Page
if: failure()
uses: actions/upload-artifact@v2
with:
name: kore-exec.tar.gz
path: |
**/kore-exec.tar.gz
ubuntu-focal:
name: 'K Ubuntu Focal Package'
runs-on: [self-hosted, linux, normal]
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
- name: 'Build and Test Package'
uses: ./.github/actions/test-package
with:
os: ubuntu
distro: focal
llvm: 12
jdk: 11
pkg-name: kframework_amd64_ubuntu_focal.deb
build-package: package/debian/build-package focal
test-package: package/debian/test-package
- name: 'Upload Package to Release'
env:
GITHUB_TOKEN: ${{ secrets.JENKINS_GITHUB_PAT }}
run: |
set -x
version=$(cat package/version)
cp kframework_amd64_ubuntu_focal.deb kframework_${version}_amd64_ubuntu_focal.deb
gh release upload --repo runtimeverification/k --clobber v${version} kframework_${version}_amd64_ubuntu_focal.deb
- name: 'Build, Test, and Push Dockerhub Image'
shell: bash {0}
env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPO: runtimeverificationinc/kframework-k
run: |
set -euxo pipefail
version=$(cat package/version)
version_tag=ubuntu-focal-${version}
docker login --username rvdockerhub --password ${DOCKERHUB_PASSWORD}
docker image build . --file package/docker/Dockerfile.ubuntu-focal --tag ${DOCKERHUB_REPO}:${version_tag}
docker run --name k-package-docker-test-focal-${GITHUB_SHA} --rm -it --detach ${DOCKERHUB_REPO}:${version_tag}
docker exec -t k-package-docker-test-focal-${GITHUB_SHA} bash -c 'cd ~ && echo "module TEST imports BOOL endmodule" > test.k'
docker exec -t k-package-docker-test-focal-${GITHUB_SHA} bash -c 'cd ~ && kompile test.k --backend llvm'
docker exec -t k-package-docker-test-focal-${GITHUB_SHA} bash -c 'cd ~ && kompile test.k --backend haskell'
docker image push ${DOCKERHUB_REPO}:${version_tag}
- name: 'Clean up Docker Container'
if: always()
run: |
docker stop --time=0 k-package-docker-test-focal-${GITHUB_SHA}
- name: On Failure, Upload the kore-exec.tar.gz file to the Summary Page
if: failure()
uses: actions/upload-artifact@v2
with:
name: kore-exec.tar.gz
path: |
**/kore-exec.tar.gz
debian-bookworm:
name: 'K Debian Bookworm Package'
runs-on: [self-hosted, linux, normal]
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
- name: 'Build and Test Package'
uses: ./.github/actions/test-package
with:
os: debian
distro: bookworm
llvm: 14
pkg-name: kframework_amd64_debian_bookworm.deb
build-package: package/debian/build-package bookworm
test-package: package/debian/test-package
- name: 'Upload Package to Release'
env:
GITHUB_TOKEN: ${{ secrets.JENKINS_GITHUB_PAT }}
run: |
set -x
version=$(cat package/version)
cp kframework_amd64_debian_bookworm.deb kframework_${version}_amd64_debian_bookworm.deb
gh release upload --repo runtimeverification/k --clobber v${version} kframework_${version}_amd64_debian_bookworm.deb
arch:
name: 'Arch Linux Package'
runs-on: [self-hosted, linux, normal]
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
- name: 'Build and Test Package'
uses: ./.github/actions/test-package
with:
dockerfile: package/arch/Dockerfile
os: archlinux
distro: base
build-package: package/arch/build-package
test-package: package/arch/test-package
pkg-name: kframework_arch_x86_64.pkg.tar.zst
- name: 'Upload Package to Release'
env:
GITHUB_TOKEN: ${{ secrets.JENKINS_GITHUB_PAT }}
run: |
set -x
version=$(cat package/version)
cp kframework_arch_x86_64.pkg.tar.zst kframework_${version}_arch_x86_64.pkg.tar.zst
gh release upload --repo runtimeverification/k --clobber v${version} kframework_${version}_arch_x86_64.pkg.tar.zst
macos-build:
name: 'Build MacOS Package'
runs-on: macos-11
timeout-minutes: 120
environment: production
needs: [set-release-id, source-tarball]
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: recursive
path: kframework
- name: Check out matching homebrew repo branch
uses: actions/checkout@v3
id: checkout
with:
repository: kframework/homebrew-k
path: homebrew-k
ref: staging
continue-on-error: true
- name: Check out homebrew repo master branch
uses: actions/checkout@v3
if: ${{ steps.checkout.outcome == 'failure' }}
with:
repository: kframework/homebrew-k
path: homebrew-k
- name: Cache maven
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-
restore-keys: |
${{ runner.os }}-maven-
- name: Build brew bottle
id: build
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
MAVEN_OPTS: >-
-Dhttp.keepAlive=false
-Dmaven.wagon.http.pool=false
-Dmaven.wagon.httpconnectionManager.ttlSeconds=30
run: |
PACKAGE=kframework
VERSION=$(cat kframework/package/version)
ROOT_URL='https://github.com/runtimeverification/k/releases/download'
wget "$ROOT_URL/v${VERSION}/kframework-${VERSION}-src.tar.gz"
cd homebrew-k
../kframework/package/macos/brew-update-to-local ${PACKAGE} ${VERSION}
git commit Formula/$PACKAGE.rb -m "Update ${PACKAGE} to ${VERSION}: part 1"
../kframework/package/macos/brew-build-and-update-to-local-bottle ${PACKAGE} ${VERSION} ${ROOT_URL}
git reset HEAD^
LOCAL_BOTTLE_NAME=$(basename $(find . -name "kframework--${VERSION}.big_sur.bottle*.tar.gz"))
BOTTLE_NAME=$(echo ${LOCAL_BOTTLE_NAME#./} | sed 's!kframework--!kframework-!')
../kframework/package/macos/brew-update-to-final ${PACKAGE} ${VERSION} ${ROOT_URL}
echo "path=${LOCAL_BOTTLE_NAME}" >> ${GITHUB_OUTPUT}
echo "path_remote=${BOTTLE_NAME}" >> ${GITHUB_OUTPUT}
echo "version=${VERSION}" >> ${GITHUB_OUTPUT}
- name: Upload bottle
uses: actions/upload-artifact@v2
with:
name: homebrew
path: homebrew-k
- name: Delete Release
if: failure()
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { owner, repo } = context.repo
await github.rest.repos.deleteRelease({ owner, repo, release_id: ${{ needs.set-release-id.outputs.release_id }} })
outputs:
bottle_path: ${{ steps.build.outputs.path }}
bottle_path_remote: ${{ steps.build.outputs.path_remote }}
version: ${{ steps.build.outputs.version }}
macos-test:
name: 'Test MacOS Package'
runs-on: macos-11
timeout-minutes: 60
environment: production
needs: [macos-build, set-release-id]
steps:
- name: 'Check out matching homebrew repo branch'
uses: actions/checkout@v3
id: checkout
with:
repository: kframework/homebrew-k
path: homebrew-k
ref: staging
persist-credentials: false
continue-on-error: true
- name: 'Check out homebrew repo master branch'
uses: actions/checkout@v3
if: ${{ steps.checkout.outcome == 'failure' }}
with:
repository: kframework/homebrew-k
path: homebrew-k
persist-credentials: false
- name: 'Download bottle'
uses: actions/download-artifact@v2
with:
name: homebrew
path: homebrew-k-old
- name: 'Test brew bottle'
id: test
env:
# github actions sets the JAVA_HOME variable to Java 8 explicitly for
# some reason. There doesn't seem to be a way to tell it to unset the
# variable, so instead we just have to tell it to use Java 11
# explicitly intead.
JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }}
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: |
cd homebrew-k-old
brew tap kframework/k "file:///$(pwd)"
brew install ${{ needs.macos-build.outputs.bottle_path }} -v
cp -R /usr/local/share/kframework/pl-tutorial ~
WD=`pwd`
cd
echo 'Starting kserver...'
spawn-kserver $WD/kserver.log
cd pl-tutorial
echo 'Testing tutorial in user environment...'
make -j`sysctl -n hw.ncpu` ${MAKE_EXTRA_ARGS}
cd ~
echo 'module TEST imports BOOL endmodule' > test.k
kompile test.k --backend llvm
kompile test.k --backend haskell
- name: 'Check out code'
uses: actions/checkout@v3
with:
path: k-homebrew-checkout
- name: 'Upload Package to Release'
env:
GITHUB_TOKEN: ${{ secrets.JENKINS_GITHUB_PAT }}
BOTTLE_NAME: ${{ needs.macos-build.outputs.bottle_path }}
REMOTE_BOTTLE_NAME: ${{ needs.macos-build.outputs.bottle_path_remote }}
run: |
set -x
version=$(cat k-homebrew-checkout/package/version)
mv homebrew-k-old/${BOTTLE_NAME} homebrew-k-old/${REMOTE_BOTTLE_NAME}
gh release upload --repo runtimeverification/k --clobber v${version} homebrew-k-old/${REMOTE_BOTTLE_NAME}
- name: 'Add ssh key'
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.HOMEBREW_SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS_GITHUB_COM }}
- name: 'Commit changes'
run: |
cp homebrew-k-old/Formula/kframework.rb homebrew-k/Formula/kframework.rb
cd homebrew-k
git commit -m 'Update brew package version' Formula/kframework.rb
git remote set-url origin [email protected]:kframework/homebrew-k.git
git push origin master
- name: 'Delete Release'
if: failure()
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { owner, repo } = context.repo
await github.rest.repos.deleteRelease({ owner, repo, release_id: ${{ needs.set-release-id.outputs.release_id }} })
release:
name: 'Publish Release'
runs-on: [self-hosted, linux, normal]
environment: production
needs: [nix-release, macos-build, macos-test, source-tarball, ubuntu-jammy, ubuntu-focal, debian-bookworm, set-release-id, arch]
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Java for publishing to GitHub Maven Packages
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
overwrite-settings: true
server-id: runtime.verification.snapshots
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
# Build and Run Tests in Docker
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
tag: k-release-ci-${{ github.sha }}
os: ubuntu
distro: jammy
llvm: 14
- name: 'Push Maven Packages'
shell: bash {0}
continue-on-error: true
env:
MAVEN_USERNAME: [email protected]
MAVEN_PASSWORD: ${{ secrets.CLOUDREPO_PASSWORD }}
run: |
cat ~/.m2/settings.xml
docker exec -t k-release-ci-${GITHUB_SHA} bash -c 'mkdir -p /home/github-runner/.m2'
docker cp ~/.m2/settings.xml k-release-ci-${GITHUB_SHA}:/tmp/settings.xml
docker exec -t k-release-ci-${GITHUB_SHA} bash -c 'mv /tmp/settings.xml /home/github-runner/.m2/settings.xml'
docker exec -e MAVEN_USERNAME -e MAVEN_PASSWORD -t k-release-ci-${GITHUB_SHA} bash -c "mvn --batch-mode deploy"
- name: 'Tear down Docker'
if: always()
run: |
docker stop --time=0 k-release-ci-${GITHUB_SHA}
docker container rm --force k-release-ci-${GITHUB_SHA} || true
- name: Publish release
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { owner, repo } = context.repo
await github.rest.repos.updateRelease({ owner, repo, release_id: ${{ needs.set-release-id.outputs.release_id }}, prerelease: false })
- name: 'Update dependents'
env:
GITHUB_TOKEN: ${{ secrets.JENKINS_GITHUB_PAT }}
VERSION: ${{ needs.macos-build.outputs.version }}
run: |
set -x
version=v"${VERSION}"
curl --fail \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-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/k","version":"'${VERSION}'"}}'
gh-pages:
name: 'GitHub Pages deployment'
runs-on: ubuntu-20.04
timeout-minutes: 30
needs: [release]
steps:
- name: 'Install pandoc/texlive/calibre'
run: |
sudo apt update --yes
sudo apt install --yes wget texlive-xetex
sudo wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin version=5.42.0
sudo wget https://github.com/jgm/pandoc/releases/download/2.18/pandoc-2.18-1-amd64.deb -O /tmp/pandoc.deb
sudo dpkg -i /tmp/pandoc.deb
- name: 'Checkout code and set up web build'
uses: actions/checkout@v3
with:
submodules: recursive
path: gh-pages
token: ${{ secrets.JENKINS_GITHUB_PAT }}
fetch-depth: 0
- working-directory: gh-pages
run: |
git config --global user.name rv-jenkins
git config --global user.email [email protected]
git checkout --orphan gh-pages origin/master
- name: 'Build webpage'
working-directory: gh-pages
run: |
export PATH="$PATH":/opt/calibre
cd web
npm install
npm run build
npm run build-book
npm run build-sitemap
cd -
mv web/public_content ./
rm -rf $(find . -maxdepth 1 -not -name public_content -a -not -name .git -a -not -path . -a -not -path .. -a -not -name CNAME)
mv public_content/* ./
rm -rf public_content
- name: 'Push gh-pages branch'
working-directory: gh-pages
run: |
set -x
git add ./
git commit -m 'gh-pages: Updated the website'
git push --force origin gh-pages