Auto Update #273
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
name: Auto Update | |
on: | |
schedule: | |
- cron: '0 13 * * 1,3,5' # runs at 13:00 UTC every Mon., Wed., Fri. | |
# - cron: '*/15 * * * *' # runs every 15min | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
output1: ${{ steps.runpy.outputs.test }} | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fetch-depth: 0 | |
- uses: fregante/setup-git-user@v1 | |
- name: setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: install python packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: execute py script | |
id: runpy | |
env: | |
EMAIL_ADDRESS: ${{ secrets.EMAIL_ADDRESS }} | |
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }} | |
EMAIL_RECIPIENT: ${{ secrets.EMAIL_RECIPIENT }} | |
run: | | |
output=$(python exfor_trans.py) | |
echo ::set-output name=NP::$output | |
# echo "{NP}=$output" >> $GITHUB_OUTPUT | |
# echo ::set-output name=NP::$output | |
- name: create release using REST API | |
shell: bash | |
run: | | |
for not_processed in ${{ steps.runpy.outputs.NP }}; do | |
echo $not_processed | |
tagname="Backup-"$not_processed | |
echo $tagname | |
sem_release=$(bash ${GITHUB_WORKSPACE}/script/semantic_release_name.sh $not_processed) | |
echo $sem_release | |
curl -X POST https://api.github.com/repos/${{ github.repository }}/releases \ | |
--header "Accept: application/vnd.github+json" \ | |
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | |
--data '{ | |
"tag_name": "'$tagname'", | |
"name": "'$sem_release'", | |
"draft": false, | |
"prerelease": false, | |
"generate_release_notes": false | |
}'\ | |
--fail | |
done | |
- name: run entry update list file script and commit file | |
run: | | |
if [[ -n "${{ steps.runpy.outputs.NP }}" ]] | |
then | |
bash ${GITHUB_WORKSPACE}/script/get_update_date.sh > entry_updatedate.dat | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add entry_updatedate.dat | |
git commit -m "update entry_updatedate.dat" | |
git push origin main | |
else | |
echo "no update" | |
fi |