bump-date.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #
  2. # bump-date.yml
  3. # Bump the distribution date once per day
  4. #
  5. name: Bump Distribution Date
  6. on:
  7. schedule:
  8. - cron: '0 */6 * * *'
  9. jobs:
  10. bump_date:
  11. name: Bump Distribution Date
  12. if: github.repository == 'MarlinFirmware/Marlin'
  13. runs-on: ubuntu-22.04
  14. steps:
  15. - name: Check out bugfix-2.0.x
  16. uses: actions/checkout@v4
  17. with:
  18. ref: bugfix-2.0.x
  19. - name: Bump Date (bugfix-2.0.x)
  20. run: |
  21. # Inline Bump Script
  22. if [[ ! "$( git log -1 --pretty=%B )" =~ ^\[cron\] ]]; then
  23. DIST=$( date +"%Y-%m-%d" )
  24. eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \
  25. eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \
  26. git config user.name "${GITHUB_ACTOR}" && \
  27. git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \
  28. git add . && \
  29. git commit -m "[cron] Bump distribution date ($DIST)" && \
  30. git push
  31. fi
  32. exit 0
  33. - name: Check out bugfix-2.1.x
  34. uses: actions/checkout@v4
  35. with:
  36. ref: bugfix-2.1.x
  37. - name: Bump Date (bugfix-2.1.x)
  38. run: |
  39. # Inline Bump Script
  40. if [[ ! "$( git log -1 --pretty=%B )" =~ ^\[cron\] ]]; then
  41. DIST=$( date +"%Y-%m-%d" )
  42. eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \
  43. eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \
  44. git config user.name "${GITHUB_ACTOR}" && \
  45. git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \
  46. git add . && \
  47. git commit -m "[cron] Bump distribution date ($DIST)" && \
  48. git push
  49. fi
  50. exit 0