|
| 1 | +name: "release-please" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "main" |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: "${{ github.workflow }}-${{ github.ref }}" |
| 10 | + |
| 11 | +jobs: |
| 12 | + release-please: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + outputs: |
| 16 | + releases-created: ${{ steps.release.outputs.releases_created }} |
| 17 | + |
| 18 | + ansible-release-created: ${{ steps.release.outputs['ansible--release_created'] }} |
| 19 | + ansible-version: ${{ steps.release.outputs['ansible--version'] }} |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Run release-please |
| 23 | + id: release |
| 24 | + uses: google-github-actions/release-please-action@v3 |
| 25 | + with: |
| 26 | + token: ${{ secrets.FLUENCEBOT_RELEASE_PLEASE_PAT }} |
| 27 | + command: manifest |
| 28 | + config-file: .github/release-please/config.json |
| 29 | + manifest-file: .github/release-please/manifest.json |
| 30 | + |
| 31 | + - name: Show output from release-please |
| 32 | + if: steps.release.outputs.releases_created |
| 33 | + env: |
| 34 | + RELEASE_PLEASE_OUTPUT: ${{ toJSON(steps.release.outputs) }} |
| 35 | + run: echo "${RELEASE_PLEASE_OUTPUT}" | jq |
| 36 | + |
| 37 | + ansible: |
| 38 | + if: needs.release-please.outputs.ansible-release-created |
| 39 | + runs-on: ubuntu-latest |
| 40 | + needs: |
| 41 | + - release-please |
| 42 | + |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v4 |
| 45 | + |
| 46 | + - name: Push to galaxy |
| 47 | + uses: ansible-actions/[email protected] |
| 48 | + with: |
| 49 | + path: ansible/ |
| 50 | + galaxy_api_key: ${{ secrets.GALAXY_API_KEY }} |
| 51 | + galaxy_version: ${{ needs.release-please.outputs.ansible-version }} |
| 52 | + |
| 53 | + slack: |
| 54 | + if: always() |
| 55 | + name: "Notify" |
| 56 | + runs-on: ubuntu-latest |
| 57 | + |
| 58 | + needs: |
| 59 | + - release-please |
| 60 | + - ansible |
| 61 | + |
| 62 | + permissions: |
| 63 | + contents: read |
| 64 | + id-token: write |
| 65 | + |
| 66 | + steps: |
| 67 | + - uses: lwhiteley/dependent-jobs-result-check@v1 |
| 68 | + id: status |
| 69 | + with: |
| 70 | + statuses: failure |
| 71 | + dependencies: ${{ toJSON(needs) }} |
| 72 | + |
| 73 | + - name: Log output |
| 74 | + run: | |
| 75 | + echo "statuses:" "${{ steps.status.outputs.statuses }}" |
| 76 | + echo "jobs:" "${{ steps.status.outputs.jobs }}" |
| 77 | + echo "found any?:" "${{ steps.status.outputs.found }}" |
| 78 | +
|
| 79 | + - name: Import secrets |
| 80 | + |
| 81 | + with: |
| 82 | + url: https://vault.fluence.dev |
| 83 | + path: jwt/github |
| 84 | + role: ci |
| 85 | + method: jwt |
| 86 | + jwtGithubAudience: "https://github.com/fluencelabs" |
| 87 | + jwtTtl: 300 |
| 88 | + exportToken: false |
| 89 | + secrets: | |
| 90 | + kv/slack/release-please webhook | SLACK_WEBHOOK_URL |
| 91 | +
|
| 92 | + - uses: ravsamhq/notify-slack-action@v2 |
| 93 | + if: steps.status.outputs.found == 'true' |
| 94 | + with: |
| 95 | + status: "failure" |
| 96 | + notification_title: "*{workflow}* has {status_message}" |
| 97 | + message_format: "${{ steps.status.outputs.jobs }} {status_message} in <{repo_url}|{repo}>" |
| 98 | + footer: "<{run_url}>" |
0 commit comments