Parcourir la source

change dev release address

wangweimin il y a 2 ans
Parent
commit
291a7d64a9
5 fichiers modifiés avec 21 ajouts et 27 suppressions
  1. 1 12
      .drone.yml
  2. 17 12
      .github/workflows/build_dev.yml
  3. 1 1
      README-zh.md
  4. 1 1
      README.md
  5. 1 1
      docs/index.rst

+ 1 - 12
.drone.yml

@@ -2,24 +2,13 @@ kind: pipeline
 type: exec
 name: default
 
-clone:
-  disable: true
-
 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

+ 17 - 12
.github/workflows/sync_repo.yml → .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 }}
+          # This token is provided by Actions, you do not need to create your own token
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

+ 1 - 1
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 及以上

+ 1 - 1
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

+ 1 - 1
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