|
1 | 1 | on: |
2 | | - workflow_run: |
3 | | - workflows: [Release] |
4 | | - types: [completed] |
| 2 | + release: |
| 3 | + types: [published] |
5 | 4 | workflow_dispatch: |
6 | 5 |
|
7 | 6 | name: Various Updates Post Release |
8 | 7 | jobs: |
9 | 8 | post_release: |
10 | 9 | runs-on: ubuntu-latest |
11 | | - if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} |
| 10 | + if: ${{ github.event_name == 'release' || github.event_name == 'workflow_dispatch' }} |
12 | 11 | steps: |
| 12 | + - name: Get release tag |
| 13 | + id: get_tag |
| 14 | + if: ${{ github.event_name == 'release' }} |
| 15 | + run: | |
| 16 | + # Get the release tag from the event |
| 17 | + RELEASE_TAG="${{ github.event.release.tag_name }}" |
| 18 | + echo "tag=$RELEASE_TAG" >> $GITHUB_OUTPUT |
| 19 | + echo "Release tag: $RELEASE_TAG" |
| 20 | +
|
| 21 | + # Check if it's a v1 release |
| 22 | + if [[ $RELEASE_TAG =~ ^v1\. ]]; then |
| 23 | + echo "is_v1=true" >> $GITHUB_OUTPUT |
| 24 | + echo "This is a v1 release" |
| 25 | + else |
| 26 | + echo "is_v1=false" >> $GITHUB_OUTPUT |
| 27 | + echo "This is not a v1 release, skipping" |
| 28 | + fi |
| 29 | +
|
13 | 30 | - name: Generate token |
14 | 31 | id: generate_token |
| 32 | + if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name == 'release' && steps.get_tag.outputs.is_v1 == 'true') }} |
15 | 33 | uses: tibdex/github-app-token@v2 |
16 | 34 | with: |
17 | 35 | app_id: ${{ secrets.FLIPT_RELEASE_BOT_APP_ID }} |
18 | 36 | private_key: ${{ secrets.FLIPT_RELEASE_BOT_APP_PEM }} |
19 | | - installation_id: ${{ secrets.FLIPT_RELEASE_BOT_INSTALLATION_ID }} |
20 | 37 |
|
21 | 38 | - name: Trigger Post Release Workflows |
| 39 | + if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name == 'release' && steps.get_tag.outputs.is_v1 == 'true') }} |
22 | 40 | env: |
23 | 41 | GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} |
24 | 42 | run: | |
25 | | - gh workflow run deploy.yml -R flipt-io/try.flipt.io |
26 | 43 | gh workflow run update.yml -R flipt-io/helm-charts |
0 commit comments