name: Release

on:
  push:
    tags:
      - "[0-9]+.[0-9]+.[0-9]+*"

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: shivammathur/setup-php@v2
        with:
          php-version: 7.4

      - name: Install dependencies
        run: |
          sudo apt-get update
          DEBIAN_FRONTEND=noninteractive sudo apt-get install -y gettext

      - name: Build tarball
        run: make tarball

      - name: Create Release
        uses: softprops/action-gh-release@v1
        with:
          body_path: docs/releases/3.0.0-alpha.13.md
          draft: true
          prerelease: true
          files: libretime-*.tar.gz
