version: 39
jobs:
- name: Build for x86_64
  steps:
  - !CheckoutStep
    name: Checkout
    cloneCredential: !DefaultCredential {}
    withLfs: true
    withSubmodules: false
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  - !CommandStep
    name: Execute build
    runInContainer: true
    image: onedev.site.tesses.net/dependencies/dependencies:latest
    interpreter: !DefaultInterpreter
      commands: |
        mkdir build
        cd build
        cmake -S .. -B . -DTESSESFRAMEWORK_FETCHCONTENT=OFF -DTESSESFRAMEWORK_ENABLE_SDL2=ON
        make -j12
        make install DESTDIR=out
    useTTY: true
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  - !BuildImageStep
    name: Build Docker Image
    dockerfile: Dockerfile.run
    output: !RegistryOutput
      tags: onedev.site.tesses.net/tesses-framework/tesses-framework:latest
    registryLogins:
    - registryUrl: '@server_url@'
      userName: '@job_token@'
      passwordSecret: dockersecret
    platforms: linux/amd64
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  - !CommandStep
    name: Build and Publish Deb Package
    runInContainer: true
    image: onedev.site.tesses.net/dependencies/debbuilder:latest
    interpreter: !DefaultInterpreter
      commands: |
        cd Packaging/Linux
        bash build-debian-amd64.sh
        bash push-debian-amd64.sh
    envVars:
    - name: GITEA_AUTH
      value: '@secret:GITEA_AUTH@'
    useTTY: true
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  triggers:
  - !BranchUpdateTrigger
    branches: master
    projects: tesses-framework
  retryCondition: never
  maxRetries: 3
  retryDelay: 30
  timeout: 14400
