clone:
  git:
    when:
      event:
        - tag
        - push
    image: woodpeckerci/plugin-git
    settings:
      depth: 1
      lfs: false
      recursive: false
      tags: true

steps:
  build:
    group: build
    image: danog/madelineproto:next
    when:
      event:
        - tag
        - push
    environment:
      API_ID:
        from_secret: API_ID
      API_HASH:
        from_secret: API_HASH
      DEST:
        from_secret: DEST
      BOT_TOKEN:
        from_secret: BOT_TOKEN
      GITHUB_TOKEN:
        from_secret: GITHUB_TOKEN
    commands:
      - export PLATFORM=${platform}
      - export PHP_VERSION=${php}
      - /bin/bash -e tests/makephar.sh

services:
  mariadb:
    image: mariadb
    environment:
      MARIADB_DATABASE: MadelineProtoDb
      MARIADB_USER: MadelineProtoUser
      MARIADB_PASSWORD: test
      MARIADB_RANDOM_ROOT_PASSWORD: yes

  postgres:
    image: postgres
    environment:
      POSTGRES_DB: MadelineProtoDb
      POSTGRES_USER: MadelineProtoUser
      POSTGRES_PASSWORD: test

  redis:
    image: redis


depends_on:
  - test
  - cs

