name: release
on:
  - release

jobs:
  analyse:
    name: Analyse
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: actions/setup-java@v3
        with:
          distribution: "temurin"
          java-version: "17"
      - uses: android-actions/setup-android@v3
      - uses: subosito/flutter-action@v2
        with:
          flutter-version: "3.13.0"
      - run: flutter pub get
      - run: flutter test
      - run: flutter build apk
      - name: setup go
        uses: https://github.com/actions/setup-go@v4
        with:
          go-version: ">=1.20.1"
      - name: Use Go Action
        id: use-go-action
        uses: https://gitea.com/actions/release-action@main
        with:
          files: |-
            build/app/outputs/flutter-apk/app-release.apk            
          api_key: "${{secrets.RELEASE_TOKEN}}"
