1- name : Sync with mirror repo
1+ name : build dev version
22on :
33 push :
44 branches :
55 - dev
66 repository_dispatch :
77
88jobs :
9- sync :
9+ build_dev :
1010 runs-on : ubuntu-latest
1111 steps :
1212 - name : Checkout
@@ -32,20 +32,25 @@ jobs:
3232 cd docs && CODE_EXPORT_PATH=../demos/doc_demos make clean html
3333 - name : Set dev version
3434 run : python3 tools/build_dev_version.py
35- - name : Push
35+ - name : Release dev version
3636 run : |
37+ git config --global user.email "$(git log -n 1 --pretty=format:%ae)"
38+ git config --global user.name "${{ github.actor }}"
39+
40+ # ref: https://stackoverflow.com/questions/8536732/can-i-hold-git-credentials-in-environment-variables
41+ git config --global credential.helper '!f() { sleep 1; echo "username=${{ github.actor }}"; echo "password=${GH_TOKEN}"; }; f'
42+
3743 git fetch --unshallow origin
38- git remote add aliyun "https://code.aliyun.com/wang0618/pywebio.git"
39- git config credential.helper '!f() { sleep 1; echo "username=${ALIYUN_GIT_USER}"; echo "password=${ALIYUN_GIT_PASSWORD}"; }; f'
44+ git branch -D dev-release || true
45+ git checkout -b dev-release
46+
4047 rm .gitignore
4148 git add pywebio/__version__.py
4249 git add pywebio/html/js
4350 git add demos/doc_demos
44- git config user.email "${ALIYUN_GIT_USER}"
45- git config user.name "${ALIYUN_GIT_USER}"
46- git commit --amend --no-edit
47- git push -f -u aliyun --tags || true
48- git push -f -u aliyun || true
51+
52+ git commit -m "Build at `date`"
53+ git push -f -u origin dev-release
4954 env :
50- ALIYUN_GIT_USER : ${{ secrets.ALIYUN_GIT_USER }}
51- ALIYUN_GIT_PASSWORD : ${{ secrets.ALIYUN_GIT_PASSWORD }}
55+ # This token is provided by Actions, you do not need to create your own token
56+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments