updater.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected.
  2. # You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization.
  3. # This file should be enough by itself, but feel free to tune it to your needs.
  4. # It calls updater.sh, which is where you should put the app-specific update steps.
  5. name: Check for new upstream releases
  6. on:
  7. # Allow to manually trigger the workflow
  8. workflow_dispatch:
  9. # Run it every day at 6:00 UTC
  10. schedule:
  11. - cron: '0 6 * * *'
  12. jobs:
  13. updater:
  14. runs-on: ubuntu-latest
  15. steps:
  16. - name: Fetch the source code
  17. uses: actions/checkout@v3
  18. with:
  19. token: ${{ secrets.GITHUB_TOKEN }}
  20. - name: Run the updater script
  21. id: run_updater
  22. run: |
  23. # Setting up Git user
  24. git config --global user.name 'yunohost-bot'
  25. git config --global user.email 'yunohost-bot@users.noreply.github.com'
  26. # Run the updater script
  27. /bin/bash .github/workflows/updater.sh
  28. - name: Commit changes
  29. id: commit
  30. if: ${{ env.PROCEED == 'true' }}
  31. run: |
  32. git commit -am "Upgrade to v$VERSION"
  33. - name: Create Pull Request
  34. id: cpr
  35. if: ${{ env.PROCEED == 'true' }}
  36. uses: peter-evans/create-pull-request@v4
  37. with:
  38. token: ${{ secrets.GITHUB_TOKEN }}
  39. commit-message: Update to version ${{ env.VERSION }}
  40. committer: 'yunohost-bot <yunohost-bot@users.noreply.github.com>'
  41. author: 'yunohost-bot <yunohost-bot@users.noreply.github.com>'
  42. signoff: false
  43. base: testing
  44. branch: ci-auto-update-v${{ env.VERSION }}
  45. delete-branch: true
  46. title: 'Upgrade to version ${{ env.VERSION }}'
  47. body: |
  48. Upgrade to v${{ env.VERSION }}
  49. draft: false