clone:
  git:
    image: woodpeckerci/plugin-git
    debug: true

steps:
  build:
    image: alpine:latest
    commands:
      - apk add --no-cache bash zip
      - VERSION=${CI_COMMIT_TAG#v}
      - mkdir -p build/wp-fix-plugin-does-not-exist-notices
      - cp wp-fix-plugin-does-not-exist-notices.php build/wp-fix-plugin-does-not-exist-notices/
      - cp readme.txt build/wp-fix-plugin-does-not-exist-notices/
      - cp LICENSE build/wp-fix-plugin-does-not-exist-notices/
      - cp README.md build/wp-fix-plugin-does-not-exist-notices/
      - if [ -f CHANGELOG.md ]; then cp CHANGELOG.md build/wp-fix-plugin-does-not-exist-notices/; fi
      - cd build
      - zip -r ../wp-fix-plugin-does-not-exist-notices-$VERSION.zip wp-fix-plugin-does-not-exist-notices
      - cd ..
      - echo "Build completed - wp-fix-plugin-does-not-exist-notices-$VERSION.zip"
      - ls -la *.zip

  release:
    image: plugins/gitea-release
    environment:
      PLUGIN_API_KEY:
        from_secret: gitea_token
      PLUGIN_BASE_URL: https://gitea.wpallstars.com
      PLUGIN_FILES: wp-fix-plugin-does-not-exist-notices-*.zip
      PLUGIN_TITLE: "Release ${CI_COMMIT_TAG}"
      PLUGIN_NOTE: "Fix 'Plugin file does not exist.' Notices ${CI_COMMIT_TAG}\n\nSee [CHANGELOG.md](https://gitea.wpallstars.com/wpallstars/wp-fix-plugin-does-not-exist-notices/src/branch/main/CHANGELOG.md) for details."

  test:
    image: alpine:latest
    commands:
      - echo "Hello from Woodpecker CI"
      - echo "Testing minimal configuration"

when:
  event: [push, tag, pull_request]