---
name: Release

on:
  pull_request:
    branches: [master]
    paths:
      - 'configure.ac'

jobs:
  ci-release-build:
    name: "Sanity check release commits"
    if: ${{ github.event.label.name == 'kind/release' || startsWith(github.event.pull_request.title, 'Release') }}
    runs-on: ubuntu-latest
    steps:
      - name: Clone repository
        uses: actions/checkout@v2
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          submodules: 'recursive'
          fetch-depth: '0'
      - name: Checkout (HEAD)
        run: git checkout HEAD
      - name: Check release sanity (HEAD)
        run: ci/ci-release-build.sh
      - name: Checkout (HEAD^)
        run: git checkout HEAD^
      - name: Check release sanity (HEAD^)
        run: ci/ci-release-build.sh
