when:
  branch: main

variables:
  - &file Dockerfile

steps:
  build:
    image: docker.io/golang:bookworm
    commands:
      - apt-get update
      - apt-get install -y make gcc libgpgme-dev build-essential pkgconf pkgconf-bin libdevmapper-dev libbtrfs-dev
      - go mod download
      - go mod tidy
      - CGO_ENABLED=1 go build -buildvcs=true .
    when:
      event: [ pull-request, push]
  publish:
    image: woodpeckerci/plugin-gitea-release
    settings:
        base_url: https://git.jmbit.de
        files:
          # Could also be "hello-world*" to match both
          - "podterminal"
          - "exampleconfig.yaml"
        api_key:
          from_secret: FORGEJO_TOKEN
        target: main
    when:
      event: push

