new_version_check.yml 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. name: New version check
  2. on:
  3. # enabling manual trigger
  4. workflow_dispatch:
  5. # running every hour
  6. schedule:
  7. - cron: '48 * * * *'
  8. jobs:
  9. check:
  10. # do not run in forks
  11. if: github.repository == 'ungoogled-software/ungoogled-chromium'
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Set maintainer groups
  15. id: maintainers
  16. run: |
  17. echo "all=@networkException" >> $GITHUB_OUTPUT
  18. echo "linux=@rany2 @clickot @emilylange" >> $GITHUB_OUTPUT
  19. echo "windows=" >> $GITHUB_OUTPUT
  20. echo "macos=" >> $GITHUB_OUTPUT
  21. - name: Get the latest Chromium version
  22. id: latest-version
  23. run: |
  24. set -eo pipefail
  25. BASE_URL="https://versionhistory.googleapis.com/v1/chrome/platforms"
  26. END_URL="channels/stable/versions/all/releases?filter=endtime%3Dnone%2Cfraction%3E%3D0.5&order_by=version%20desc"
  27. JQ_FILTER='if .releases | select(type=="array") | length > 0 then .releases | first | .version else "null" end'
  28. for platform in linux win mac; do
  29. printf %s "${platform}_version=" >> $GITHUB_OUTPUT
  30. curl -sf "${BASE_URL}/${platform}/${END_URL}" | jq -re "${JQ_FILTER}" >> $GITHUB_OUTPUT
  31. done
  32. - uses: actions/checkout@v3
  33. - name: Create Issue for all platforms
  34. if: |
  35. contains(steps.latest-version.outputs.win_version, steps.latest-version.outputs.mac_version) &&
  36. contains(steps.latest-version.outputs.mac_version, steps.latest-version.outputs.linux_version) &&
  37. !contains(steps.latest-version.outputs.linux_version, 'null')
  38. uses: dblock/create-a-github-issue@v3
  39. env:
  40. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  41. VERSION: ${{ steps.latest-version.outputs.linux_version }}
  42. PLATFORM: all platforms
  43. NOTIFY_MAINTAINERS: "${{ steps.maintainers.outputs.all }} ${{ steps.maintainers.outputs.linux }} ${{ steps.maintainers.outputs.windows }} ${{ steps.maintainers.outputs.macos }}"
  44. with:
  45. update_existing: false
  46. search_existing: all
  47. filename: .github/ISSUE_TEMPLATE/create-an--updating-to-chromium-x-x-x-x-.md
  48. - name: Create Issue for Linux
  49. if: |
  50. (
  51. !contains(steps.latest-version.outputs.win_version, steps.latest-version.outputs.mac_version) ||
  52. !contains(steps.latest-version.outputs.mac_version, steps.latest-version.outputs.linux_version)
  53. ) && !contains(steps.latest-version.outputs.linux_version, 'null')
  54. uses: dblock/create-a-github-issue@v3
  55. env:
  56. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  57. VERSION: ${{ steps.latest-version.outputs.linux_version }}
  58. PLATFORM: Linux
  59. NOTIFY_MAINTAINERS: "${{ steps.maintainers.outputs.all }} ${{ steps.maintainers.outputs.linux }}"
  60. with:
  61. update_existing: false
  62. search_existing: all
  63. filename: .github/ISSUE_TEMPLATE/create-an--updating-to-chromium-x-x-x-x-.md
  64. - name: Create Issue for macOS
  65. if: |
  66. (
  67. !contains(steps.latest-version.outputs.win_version, steps.latest-version.outputs.mac_version) ||
  68. !contains(steps.latest-version.outputs.mac_version, steps.latest-version.outputs.linux_version)
  69. ) && !contains(steps.latest-version.outputs.mac_version, 'null')
  70. uses: dblock/create-a-github-issue@v3
  71. env:
  72. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  73. VERSION: ${{ steps.latest-version.outputs.mac_version }}
  74. PLATFORM: macOS
  75. NOTIFY_MAINTAINERS: "${{ steps.maintainers.outputs.all }} ${{ steps.maintainers.outputs.macos }}"
  76. with:
  77. update_existing: false
  78. search_existing: all
  79. filename: .github/ISSUE_TEMPLATE/create-an--updating-to-chromium-x-x-x-x-.md
  80. - name: Create Issue for Windows
  81. if: |
  82. (
  83. !contains(steps.latest-version.outputs.win_version, steps.latest-version.outputs.mac_version) ||
  84. !contains(steps.latest-version.outputs.mac_version, steps.latest-version.outputs.linux_version)
  85. ) && !contains(steps.latest-version.outputs.win_version, 'null')
  86. uses: dblock/create-a-github-issue@v3
  87. env:
  88. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  89. VERSION: ${{ steps.latest-version.outputs.win_version }}
  90. PLATFORM: Windows
  91. NOTIFY_MAINTAINERS: "${{ steps.maintainers.outputs.all }} ${{ steps.maintainers.outputs.windows }}"
  92. with:
  93. update_existing: false
  94. search_existing: all
  95. filename: .github/ISSUE_TEMPLATE/create-an--updating-to-chromium-x-x-x-x-.md