android-publish.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # SPDX-FileCopyrightText: 2024 yuzu Emulator Project
  2. # SPDX-License-Identifier: GPL-2.0-or-later
  3. name: yuzu-android-publish
  4. on:
  5. schedule:
  6. - cron: '37 0 * * *'
  7. workflow_dispatch:
  8. inputs:
  9. android:
  10. description: 'Whether to trigger an Android build (true/false/auto)'
  11. required: false
  12. default: 'true'
  13. jobs:
  14. android:
  15. runs-on: ubuntu-latest
  16. if: ${{ github.event.inputs.android != 'false' && github.repository == 'yuzu-emu/yuzu' }}
  17. steps:
  18. # this checkout is required to make sure the GitHub Actions scripts are available
  19. - uses: actions/checkout@v3
  20. name: Pre-checkout
  21. with:
  22. submodules: false
  23. - uses: actions/github-script@v6
  24. id: check-changes
  25. name: 'Check for new changes'
  26. env:
  27. # 24 hours
  28. DETECTION_TIME_FRAME: 86400000
  29. with:
  30. script: |
  31. if (context.payload.inputs && context.payload.inputs.android === 'true') return true;
  32. const checkAndroidChanges = require('./.github/workflows/android-merge.js').checkAndroidChanges;
  33. return checkAndroidChanges(github);
  34. - run: npm install execa@5
  35. if: ${{ steps.check-changes.outputs.result == 'true' }}
  36. - uses: actions/checkout@v3
  37. name: Checkout
  38. if: ${{ steps.check-changes.outputs.result == 'true' }}
  39. with:
  40. path: 'yuzu-merge'
  41. fetch-depth: 0
  42. submodules: true
  43. token: ${{ secrets.ALT_GITHUB_TOKEN }}
  44. - uses: actions/github-script@v5
  45. name: 'Check and merge Android changes'
  46. if: ${{ steps.check-changes.outputs.result == 'true' }}
  47. env:
  48. ALT_GITHUB_TOKEN: ${{ secrets.ALT_GITHUB_TOKEN }}
  49. with:
  50. script: |
  51. const execa = require("execa");
  52. const mergebot = require('./.github/workflows/android-merge.js').mergebot;
  53. process.chdir('${{ github.workspace }}/yuzu-merge');
  54. mergebot(github, context, execa);