when:
  branch: master
  event: tag

steps:
  build:
    image: alpine/git
    commands:
      - apk add ansible
      - export ANSIBLE_COLLECTION=slococo/playground
      - cd "$ANSIBLE_COLLECTION"
      - ansible-galaxy collection build --output-path "$CI_WORKSPACE"

  publish:
    image: woodpeckerci/plugin-gitea-release
    settings:
      base_url: https://git.slc.ar
      files:
        - "slococo-playground-${CI_COMMIT_TAG##v}.tar.gz"
      api_key:
        from_secret: FORGEJO_ACCESS_TOKEN
      target: master

depends_on:
  - lint
  - test