doc: 版本更新公告 #19
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: Update Announce File | |
on: | |
push: | |
paths: | |
- 'resources/announce/*.md' | |
jobs: | |
update_announce_file: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Convert Markdown to JSON | |
run: python .github/scripts/update-announce.py | |
- name: Sync with remote main branch | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action" | |
git stash push -m "Temporarily stash changes for rebase" | |
git fetch origin main | |
git rebase origin/main | |
git stash pop | |
- name: Commit and push if changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "Update announce.json files" | |
sync_to_oss: | |
needs: update_announce_file | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: Install ossutil | |
run: | | |
wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 | |
chmod 755 ossutil64 | |
- name: Config ossutil | |
env: | |
OSS_ENDPOINT: 'oss-cn-beijing.aliyuncs.com' | |
OSS_ACCESS_KEY_ID: ${{ secrets.OSS_ACCESS_KEY_ID }} | |
OSS_ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }} | |
run: | | |
./ossutil64 config -e $OSS_ENDPOINT -i $OSS_ACCESS_KEY_ID -k $OSS_ACCESS_KEY_SECRET | |
- name: Sync files to OSS | |
env: | |
OSS_BUCKET: 'aowuucdn' | |
run: | | |
./ossutil64 sync -u -f ./resources/ oss://$OSS_BUCKET/resources/ |