diff --git a/.drone.yml b/.drone.yml index e4a44fec..2d4a2537 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,19 +7,11 @@ clone: trigger: branch: - - dev + - dev-release event: - push steps: - - name: clone - commands: - - sleep 300 # wait aliyun repo to sync - - git init - - git remote add aliyun "https://code.aliyun.com/wang0618/pywebio.git" - - git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 aliyun $DRONE_BRANCH - - git checkout --progress --force -B $DRONE_BRANCH aliyun/$DRONE_BRANCH - - git log -1 - name: deploy demos commands: - | # https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#pipe-dockerfile-through-stdin diff --git a/.github/workflows/sync_repo.yml b/.github/workflows/build_dev.yml similarity index 56% rename from .github/workflows/sync_repo.yml rename to .github/workflows/build_dev.yml index f23ce2f4..80a2047d 100644 --- a/.github/workflows/sync_repo.yml +++ b/.github/workflows/build_dev.yml @@ -1,4 +1,4 @@ -name: Sync with mirror repo +name: build dev version on: push: branches: @@ -6,7 +6,7 @@ on: repository_dispatch: jobs: - sync: + build_dev: runs-on: ubuntu-latest steps: - name: Checkout @@ -32,20 +32,25 @@ jobs: cd docs && CODE_EXPORT_PATH=../demos/doc_demos make clean html - name: Set dev version run: python3 tools/build_dev_version.py - - name: Push + - name: Release dev version run: | + git config --global user.email "$(git log -n 1 --pretty=format:%ae)" + git config --global user.name "${{ github.actor }}" + + # ref: https://stackoverflow.com/questions/8536732/can-i-hold-git-credentials-in-environment-variables + git config --global credential.helper '!f() { sleep 1; echo "username=${{ github.actor }}"; echo "password=${GH_TOKEN}"; }; f' + git fetch --unshallow origin - git remote add aliyun "https://code.aliyun.com/wang0618/pywebio.git" - git config credential.helper '!f() { sleep 1; echo "username=${ALIYUN_GIT_USER}"; echo "password=${ALIYUN_GIT_PASSWORD}"; }; f' + git branch -D dev-release || true + git checkout -b dev-release + rm .gitignore git add pywebio/__version__.py git add pywebio/html/js git add demos/doc_demos - git config user.email "${ALIYUN_GIT_USER}" - git config user.name "${ALIYUN_GIT_USER}" - git commit --amend --no-edit - git push -f -u aliyun --tags || true - git push -f -u aliyun || true + + git commit -m "Build at `date`" + git push -f -u origin dev-release env: - ALIYUN_GIT_USER: ${{ secrets.ALIYUN_GIT_USER }} - ALIYUN_GIT_PASSWORD: ${{ secrets.ALIYUN_GIT_PASSWORD }} \ No newline at end of file + # This token is provided by Actions, you do not need to create your own token + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/README-zh.md b/README-zh.md index 4ae5af6a..dc89e763 100644 --- a/README-zh.md +++ b/README-zh.md @@ -65,7 +65,7 @@ pip3 install -U pywebio 开发版安装: ```bash -pip3 install -U https://code.aliyun.com/wang0618/pywebio/repository/archive.zip +pip3 install -U https://github.com/pywebio/PyWebIO/archive/dev-release.zip ``` **系统要求**: PyWebIO要求 Python 版本在 3.5.2 及以上 diff --git a/README.md b/README.md index 322aa4a4..3043e380 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ pip3 install -U pywebio Development version: ```bash -pip3 install -U https://code.aliyun.com/wang0618/pywebio/repository/archive.zip +pip3 install -U https://github.com/pywebio/PyWebIO/archive/dev-release.zip ``` **Prerequisites**: PyWebIO requires Python 3.5.2 or newer diff --git a/docs/index.rst b/docs/index.rst index b69c63c2..8fa9200a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -26,7 +26,7 @@ Stable version:: Development version:: - pip3 install -U https://code.aliyun.com/wang0618/pywebio/repository/archive.zip + pip3 install -U https://github.com/pywebio/PyWebIO/archive/dev-release.zip **Prerequisites**: PyWebIO requires Python 3.5.2 or newer