update-cpp-sdk-on-release.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Whenever a new Firebase iOS SDK is released, this workflow triggers *another*
  2. # workflow on the Firebase C++ SDK, which will check for the iOS version update
  3. # and create a PR updating its iOS dependencies if the version number has
  4. # changed.
  5. name: update-cpp-sdk-on-release
  6. on:
  7. release:
  8. types: [ published ]
  9. jobs:
  10. trigger_cpp_sdk_update:
  11. # Only when a new release (not just the CocoaPods-* tag) is published.
  12. if: ${{ (github.event_name == 'release' && !contains(github.ref, 'CocoaPods')) }}
  13. # Fetch an authentication token for firebase-workflow-trigger, then use that
  14. # token to trigger the update-dependencies workflow in firebase-cpp-sdk.
  15. name: Trigger C++ SDK update
  16. runs-on: ubuntu-latest
  17. steps:
  18. - name: Setup python
  19. uses: actions/setup-python@v2
  20. with:
  21. python-version: 3.7
  22. - name: Check out firebase-cpp-sdk
  23. uses: actions/checkout@v2.3.1
  24. with:
  25. repository: firebase/firebase-cpp-sdk
  26. ref: main
  27. - name: Get firebase-workflow-trigger token
  28. uses: tibdex/github-app-token@v1
  29. id: generate-token
  30. with:
  31. app_id: ${{ secrets.CPP_WORKFLOW_TRIGGER_APP_ID }}
  32. private_key: ${{ secrets.CPP_WORKFLOW_TRIGGER_APP_PRIVATE_KEY }}
  33. repository: firebase/firebase-cpp-sdk
  34. - name: Trigger firebase-cpp-sdk update
  35. run: |
  36. python scripts/gha/trigger_workflow.py -t ${{ steps.generate-token.outputs.token }} -w update-dependencies.yml -p updateAndroid 0 -p updateiOS 1 -p comment "[Triggered]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) by [firebase-ios-sdk $GITHUB_REF release]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/tag/$GITHUB_REF)." -s 10 -A