diff --git a/.github/workflows/push-to-another.yaml b/.github/workflows/push-to-another.yaml index 6b29d169d..0e4c50eda 100644 --- a/.github/workflows/push-to-another.yaml +++ b/.github/workflows/push-to-another.yaml @@ -1,14 +1,33 @@ name: push to another +# - 'kong-gateway-operator-v[0-9]+.[0-9]+.[0-9]+' on: push: - branches: + tags: - '*' - + workflow_dispatch: + inputs: + tag: + description: The version to release (e.g. v1.2.3) + required: true jobs: - lint: + publish-release: + runs-on: ubuntu-latest + steps: + - uses: ncipollo/release-action@v1 + with: + body: stuff + + token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.event.inputs.tag }} + commit: ${{ github.sha }} + prerelease: ${{ github.event.inputs.prerelease }} + + copy: runs-on: ubuntu-latest + # needs: + # - publish-release steps: - name: Checkout repository @@ -21,8 +40,28 @@ jobs: with: go-version: '^1.19' + - name: strip v from tag + run: | + TAG=${{ github.event.inputs.tag }} + echo "VERSION=${TAG#v}" >> $GITHUB_ENV + + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + repository: pmalek/bundle-redhat-certified' + token: ${{ secrets.PAT_GITHUB }} + path: bundle-redhat-certified + ref: main + + - name: create and push branch + run: | + cd bundle-redhat-certified + git checkout kong-gateway-operator-${{ github.event.inputs.tag }} + git push origin kong-gateway-operator-${{ github.event.inputs.tag }} + - name: bundle - run: VERSION=0.0.3 make bundle.redhat-certified + run: VERSION=${{ env.VERSION }} make bundle.redhat-certified - name: Pushes to another repository uses: cpina/github-action-push-to-another-repository@main @@ -33,4 +72,5 @@ jobs: destination-github-username: 'pmalek' destination-repository-name: 'bundle-redhat-certified' user-email: patryk.malek@konghq.com - target-branch: main + target-branch: kong-gateway-operator-${{ github.event.inputs.tag }} + target-directory: operators/kong-gateway-operator-${{ github.event.inputs.tag }}