name: Release

on:
  workflow_dispatch: {}

jobs:
  rc:
    name: Trigger release build
    runs-on: ubuntu-latest
    container: weaveworks/eksctl-build:e4d6253ee946435478ef637a8feaf08baffa2327
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          token: ${{ secrets.WEAVEWORKSBOT_TOKEN }}
          fetch-depth: 0
      - name: Cache go-build and mod
        uses: actions/cache@v3
        with:
          path: |
            ~/.cache/go-build/
            ~/go/pkg/mod/
          key: go-${{ hashFiles('go.sum') }}
          restore-keys: |
            go-
      - name: Setup identity as weaveworksbot
        uses: ./.github/actions/setup-identity
        with:
          token: "${{ secrets.WEAVEWORKSBOT_TOKEN }}"
      - name: Push tag and open PR to default branch
        run: make prepare-release
