Skip to content

Commit

Permalink
Merge branch 'release/v1.4.14-alpha'
Browse files Browse the repository at this point in the history
  • Loading branch information
StarrySky-skyler committed May 14, 2024
2 parents 2c6d4e0 + d6ac401 commit 7543380
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/update_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,29 @@
import re
import os
import sys
from subprocess import call
from github import Github

import pysnooper


pattern = r"v\d+\.\d+\.\d+"
# github token
token = os.environ.get('GITHUB_TOKEN')
g = Github(token)
# latest tag
repo = g.get_repo('StarrySky-skyler/Share_And_Talk')
latestTag = repo.get_tags()[0]
tagName = latestTag.name
with pysnooper.snoop():
pattern = r"v\d+\.\d+\.\d+"
# github token
token = os.environ.get('GITHUB_TOKEN')
g = Github(token)
# latest tag
repo = g.get_repo('StarrySky-skyler/Share_And_Talk')
latestTag = repo.get_tags()[0]
tagName = latestTag.name

@pysnooper.snoop()
def updateMD(file):
"""
update README
param: file: README path
"""
global tagName

with open(file, encoding='utf-8') as f:
content = f.readlines()
Content = ''.join(content)
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/update_md.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Update README and publish release
run-name: Auto update README and publish release - ${{ github.event.head_commit.message }}

on:
push:
tags:
- 'v*.*.*'

workflow_dispatch:

jobs:
main:
runs-on: ubuntu-latest
Expand All @@ -21,15 +24,15 @@ jobs:
git config --global user.name "Starry Trace Sky"
git config --global user.email "starrytracesky@qq.com"
git remote update
git checkout --track origin/main
git checkout --track origin/develop
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.2'

- name: Install requirements
run: pip install -r requirements.txt
run: pip install -r requirements_action_update_md.txt

- name: Update README and Publish Release
env:
Expand All @@ -40,7 +43,7 @@ jobs:
run: |
git add -A
git commit -m "docs[bot]: Auto update README.md"
git push origin main
git checkout --track origin/develop
git merge origin/main
git push origin develop
git checkout --track origin/main
git merge origin/develop
git push origin main
2 changes: 2 additions & 0 deletions requirements_action_update_md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PySnooper==1.1.1
PyGithub==1.58.2

0 comments on commit 7543380

Please sign in to comment.