name: Bump version and publish release
on:
  workflow_dispatch: {}
  push:
    branches:
      - mm-PF-569-debug-bumper-gha

jobs:
  bump-version-publish-release:
    runs-on: ubuntu-latest
    if: "!contains( github.event.sender.login, 'broadbot')"
    steps:
      - name: Checkout current code
        id: checkout_code
        uses: actions/checkout@v2
        with:
          ref: mm-PF-569-debug-bumper-gha
      - name: Bump tag and build version
        id: bump_tag
        uses: databiosphere/github-actions/actions/bumper@v0.0.3
        env:
          GITHUB_TOKEN: ${{ secrets.BROADBOT_GITHUB_TOKEN }}
          DEFAULT_BUMP: minor
          RELEASE_BRANCHES: mm-PF-569-debug-bumper-gha
          VERSION_FILE_PATH: build.gradle
          VERSION_LINE_MATCH: ^version
      - name: Publish a release
        id: publish_release
        run: |
          echo "TODO (PF-570): ./tools/publish-release.sh $RELEASE_VERSION true"
        env:
          GITHUB_TOKEN: ${{ secrets.BROADBOT_GITHUB_TOKEN }}
          RELEASE_VERSION: ${{ steps.bump_tag.outputs.tag }}

name: Bump version and publish release
on:
  workflow_dispatch: {}
  push:
    branches:
      - mm-PF-569-debug-bumper-gha

jobs:
  bump-version-publish-release:
    runs-on: ubuntu-latest
    if: "!contains( github.event.sender.login, 'broadbot')"
    steps:
      - name: Checkout current code
        id: checkout_code
        uses: actions/checkout@v2
        with:
          ref: mm-PF-569-debug-bumper-gha
      - name: Bump tag and build version
        id: bump_tag
        uses: databiosphere/github-actions/actions/bumper@v0.0.3
        env:
          GITHUB_TOKEN: ${{ secrets.BROADBOT_GITHUB_TOKEN }}
          DEFAULT_BUMP: minor
          RELEASE_BRANCHES: mm-PF-569-debug-bumper-gha
          VERSION_FILE_PATH: build.gradle
          VERSION_LINE_MATCH: ^version
      - name: Render config
        id: render_config
        run: |
          mkdir -p rendered
          echo "$DEV_CI_SA_KEY" > rendered/ci-account.json
        env:
          DEV_CI_SA_KEY: ${{ secrets.DEV_CI_SA_KEY }}
      - name: Publish a release
        id: publish_release
        run: |
          echo "release version: $RELEASE_VERSION"
          ./tools/publish-release.sh $RELEASE_VERSION true
        env:
          GITHUB_TOKEN: ${{ secrets.BROADBOT_GITHUB_TOKEN }}
          RELEASE_VERSION: ${{ steps.bump_tag.outputs.tag }}

Add render config step to GHA.
Add render config step to GHA.
