Skip to content

UpdateReadme CI

UpdateReadme CI #728

Workflow file for this run

name: UpdateReadme CI
on:
workflow_dispatch:
schedule:
# 每天北京时间23点跑(UTC+8)
- cron: '0 15 * * *'
jobs:
UpdateReadme:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Setup Java JDK
uses: actions/setup-java@master
with:
distribution: 'oracle'
java-version: 21
- name: Check out notepad
uses: actions/checkout@master
with:
ref: master
fetch-depth: 0
- name: Check out tools
uses: actions/checkout@master
with:
ref: tools
path: tools
- name: Check out develop
uses: actions/checkout@master
with:
ref: develop
path: develop
- name: Prepare
run: |
echo Update README Start!!!
git config --global user.name github-actions
git config --global user.email github-actions@github.com
git config --global core.quotepath false
cp -r tools/files/* .
fileName=`cat NotepadFileName`
cd develop
cp -fr $fileName ..
- name: Commit And Push Update Files
run: |
noteFileName=`cat NotepadFileName`
if [ -n "$(git status --porcelain $noteFileName)" ]; then
git add $noteFileName
git commit -m "Update Files"
fi
- name: Run UpdateReadme.jar
run: |
java -jar NotepadUpdateReadme.jar
- name: Commit And Push Master
run: |
git add README.md DailyNoteSum.png DailyNoteSum
git commit -m "Auto Update README.md"
git push -f origin master
- name: Delete release
run: |
if git rev-parse --verify release;then
git push origin --delete release
fi
- name: Commit And Push release
run: |
git checkout --orphan release
git rm --cached -r .
git add `cat NotepadFileName`
git commit -m "Release"
git push -f origin release