-
Notifications
You must be signed in to change notification settings - Fork 383
56 lines (51 loc) · 1.77 KB
/
build_dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: build dev version
on:
push:
branches:
- dev
repository_dispatch:
jobs:
build_dev:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Build frontend
working-directory: ./webiojs
run: |
npm install
gulp
cp dist/pywebio.min.* ../pywebio/html/js
- name: Build doc demos
run: |
pip3 install -e ".[all]"
pip3 install -r requirements.txt
cd docs && CODE_EXPORT_PATH=../demos/doc_demos make clean html
- name: Set dev version
run: python3 tools/build_dev_version.py
- 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 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 commit -m "Build at `date`"
git push -f -u origin dev-release
env:
# This token is provided by Actions, you do not need to create your own token
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}