Bump Distribution Date #1277
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# bump-date.yml | |
# Bump the distribution date once per day | |
# | |
name: Bump Distribution Date | |
on: | |
schedule: | |
- cron: '0 12 */2 * *' | |
jobs: | |
bump_date: | |
name: Bump Distribution Date | |
if: github.repository == 'classicrocker883/MRiscoCProUI' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out 2024-May | |
uses: actions/checkout@v4 | |
with: | |
ref: 2024-May | |
- name: Bump Date (2024-May) | |
run: | | |
if [[ ! "$( git log -1 --pretty=%B )" =~ ^\[cron\] ]]; then | |
shopt -s globstar && \ | |
DIST=$( date +"%Y-%m-%d" ) | |
eval "sed -E -i 's/(\/\/#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' configurations/**/Version.h" && \ | |
eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \ | |
eval "sed -E -i 's/(\/\/#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \ | |
git config user.name "Andrew" && \ | |
git config user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" && \ | |
git add . && \ | |
git commit -m "[cron] Bump distribution date ($DIST)" && \ | |
git push | |
fi | |
exit 0 |