au.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. name: Auto Update
  2. on:
  3. workflow_dispatch: # Enable manual trigger
  4. inputs:
  5. forced_packages:
  6. description: The list of packages to forcibly update (like "pkg1:ver1 pkg2")
  7. required: false
  8. schedule:
  9. - cron: 5 */8 * * *
  10. jobs:
  11. auto_update:
  12. runs-on: windows-latest
  13. defaults:
  14. run:
  15. shell: powershell
  16. steps:
  17. - uses: actions/checkout@v2
  18. with:
  19. fetch-depth: 100
  20. - name: Check a build environment
  21. run: |
  22. Get-CimInstance win32_operatingsystem -Property Caption, OSArchitecture, Version | fl Caption, OSArchitecture, Version
  23. $PSVersionTable
  24. git --version
  25. choco --version
  26. - name: Initialize Git config
  27. run: |
  28. git config --global user.email "chocolatey@realdimensions.net"
  29. git config --global user.name "Chocolatey"
  30. git config --global core.safecrlf false
  31. - name: Install AU
  32. run: |
  33. git clone -q https://github.com/majkinetor/au.git $Env:TEMP/au
  34. . "$Env:TEMP/au/scripts/Install-AU.ps1" $Env:au_version
  35. - name: Check update for packages
  36. run: |
  37. $ErrorActionPreference = 'Continue'
  38. ./update_all.ps1 -ForcedPackages '${{ github.event.inputs.forced_packages }}'
  39. 7z a au_temp.zip $Env:TEMP\chocolatey\au\*
  40. env:
  41. # Set au version to use or omit to use the latest. Specify branch name to use development version from Github
  42. #au_version:
  43. au_push: true
  44. # Github token to commit pushed packages to repository
  45. github_user_repo: ${{ github.repository }}
  46. github_api_key: ${{ secrets.GITHUB_TOKEN }}
  47. # Mail credentials - for error notifications
  48. mail_to: ${{ secrets.MAIL_TO }}
  49. mail_from: ${{ secrets.MAIL_FROM }}
  50. mail_user: ${{ secrets.MAIL_USER }}
  51. mail_pass: ${{ secrets.MAIL_PASS }}
  52. mail_server: mail.douglasthrift.net
  53. mail_port: 587
  54. mail_enablessl: true
  55. # ID of the gist used to save run results - create a gist under the github_user (secret or not) and grab the id - https://gist.github.com/name/id
  56. # Optional, leave empty to create anonymous gist
  57. gist_id: d98014ed4fcaa5cc65bb902f21ce366a
  58. # Force test: gist id for test results
  59. gist_id_test: b003c5505c6cc5c6a67f8de9e68c183
  60. # Chocolatey API key - to push updated packages
  61. api_key: ${{ secrets.CHOCOLATEY_API_KEY }}
  62. - name: Upload update results
  63. uses: actions/upload-artifact@v2
  64. with:
  65. name: update_results
  66. path: |
  67. update_info.xml
  68. Update-AUPackages.md
  69. au_temp.zip