Nightly Build #1025
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: Nightly Build | |
# Run the nightly build at 8 AM UTC / 2 AM Central | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 8 * * *" | |
jobs: | |
kind2-linux-bin: | |
if: github.repository == 'kind2-mc/kind2' | |
runs-on: ubuntu-latest | |
services: | |
registry: | |
image: registry:2 | |
ports: | |
- 5000:5000 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver-opts: network=host | |
- name: Build and push to local registry | |
uses: docker/build-push-action@v3 | |
with: | |
file: docker/Dockerfile | |
context: ./ | |
target: builder | |
push: true | |
tags: localhost:5000/name/kind2:latest | |
- name: Extract kind 2 binary | |
id: extract | |
uses: shrink/actions-docker-extract@v2 | |
with: | |
image: localhost:5000/name/kind2:latest | |
path: /home/opam/kind2-build/bin/kind2 | |
- name: Upload kind2 binary | |
uses: actions/upload-artifact@v3 | |
with: | |
path: ${{ steps.extract.outputs.destination }} | |
name: linux | |
kind2-macos-bin: | |
if: github.repository == 'kind2-mc/kind2' | |
strategy: | |
matrix: # Single configuration | |
ocaml-version: [ 4.14.1 ] | |
# Only matrix variables can be used at runs-on | |
os: [ macos-11 ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up OCaml ${{ matrix.ocaml-version }}+flambda | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
ocaml-compiler: ocaml-variants.${{ matrix.ocaml-version }}+options,ocaml-option-flambda | |
- name: Install Kind2 OCaml dependencies | |
run: opam install -y . --deps-only | |
- name: Build Kind 2 | |
run: opam exec make static | |
- name: Strip binary | |
run: strip bin/kind2 | |
- name: Upload Kind 2 binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.os }} | |
path: bin/kind2 | |
get-ready-release: | |
if: github.repository == 'kind2-mc/kind2' && !failure() | |
runs-on: ubuntu-latest | |
needs: [kind2-linux-bin, kind2-macos-bin] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Delete old assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
ids=$(gh release view nightly --json assets --jq '.assets | map(.name) | .[]') | |
for id in $ids; | |
do | |
gh release delete-asset nightly $id -y | |
done | |
- name: Update nightly tag | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git tag -f nightly | |
git push --tags -f | |
upload-artifact: | |
if: github.repository == 'kind2-mc/kind2' && !failure() | |
runs-on: ubuntu-latest | |
needs: [get-ready-release] | |
strategy: | |
matrix: | |
version: [linux, macos-11] | |
steps: | |
- name: Download binary | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.version }} | |
- name: Create tar.gz file | |
id: create_tarball | |
run: | | |
chmod u+x kind2 | |
date=$(date "+%Y-%m-%d") | |
tarball=kind2-$date-${{ matrix.version }}-x86_64.tar.gz | |
tar -czf $tarball kind2 | |
echo "filename=$tarball" >> $GITHUB_OUTPUT | |
- name: Upload release asset | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload nightly \ | |
${{ steps.create_tarball.outputs.filename }} \ | |
--repo $GITHUB_REPOSITORY |