Skip to content

chore(Codeforces & AtCoder): 调整设置页面 #101

chore(Codeforces & AtCoder): 调整设置页面

chore(Codeforces & AtCoder): 调整设置页面 #101

name: Update Script File
on:
push:
branches:
- main
paths:
- 'script/**.js'
jobs:
update-version-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Read versions and update JSON
run: |
node .github/scripts/update-version.js
git add script/versions.json
- name: Sync with remote main branch
run: |
git config --global user.email "action@github.com"
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 script versions file"
sync_to_oss:
needs: update-version-json
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 ./script/ oss://$OSS_BUCKET/script/