Skip to content

Commit

Permalink
Merge f7ac8f2 into c6e4b38
Browse files Browse the repository at this point in the history
  • Loading branch information
qianmoQ authored Mar 17, 2022
2 parents c6e4b38 + f7ac8f2 commit 9073179
Show file tree
Hide file tree
Showing 51 changed files with 1,802 additions and 12,476 deletions.
132 changes: 132 additions & 0 deletions .github/workflows/publish-release-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Publish New Release by Test Environment

on:
pull_request:
branch:
- 'test'

jobs:
release:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@master

- name: Read package.json
id: package-version
uses: tyankatsu0105/read-package-version-actions@v1
with:
path: './'

- name: Create Release
id: create_release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ steps.package-version.outputs.version }}
release_name: ${{ steps.package-version.outputs.version }}
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ steps.package-version.outputs.version }}


build-mac:
runs-on: macos-latest
needs: release
steps:

- name: Checkout
uses: actions/checkout@master

- name: Build
uses: actions/setup-node@master
- run: npm cache clear --force
- run: npm install yarn --legacy-peer-deps
- run: yarn add ajv-formats
- run: yarn install
- run: yarn run release

- name: Upload Release Asset For dmg
uses: actions/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./release/dbm-${{ needs.release.outputs.version }}-mac-x64.dmg
asset_name: dbm-${{ needs.release.outputs.version }}-mac-x64.dmg
asset_content_type: application/x-tg

- name: Upload Release Asset For zip
uses: actions/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./release/dbm-${{ needs.release.outputs.version }}-mac-x64.zip
asset_name: dbm-${{ needs.release.outputs.version }}-mac-x64.zip
asset_content_type: application/zip

- name: Upload Release Asset For yml
uses: actions/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./release/latest-mac.yml
asset_name: latest-mac-inter.yml
asset_content_type: application/x-yaml

- name: Download and upload to qiniu
run: |
wget https://devtools.qiniu.com/qshell-v2.6.2-darwin-amd64.tar.gz
tar -xvzf qshell-v2.6.2-darwin-amd64.tar.gz
# echo '--------- Start ---------'
# ./qshell account ${{ env.TOKEN_AK }} ${{ env.TOKEN_SK }}
# echo '--------- End ---------'
./qshell account 5eua7TZfgnNb81gmVUBcw4x7PpQuy-v9v1iFyD1R zCwoByIkA9AnlK0qO0DGveH7dKDXLG3CRqZ2mlTW dbm_qiniu
./qshell fput edurtio-other dbm/releases/darwin/x64/dbm-${{ needs.release.outputs.version }}-mac-x64.dmg ./release/dbm-${{ needs.release.outputs.version }}-mac-x64.dmg --overwrite
./qshell fput edurtio-other dbm/releases/darwin/x64/dbm-${{ needs.release.outputs.version }}-mac-x64.zip ./release/dbm-${{ needs.release.outputs.version }}-mac-x64.zip --overwrite
./qshell fput edurtio-other dbm/releases/darwin/x64/latest-mac.yml ./release/latest-mac.yml --overwrite
build-win:
runs-on: windows-latest
needs: release
steps:

- name: Checkout
uses: actions/checkout@master

- name: Build
uses: actions/setup-node@master
- run: npm cache clear --force
- run: npm install yarn --legacy-peer-deps
- run: yarn add ajv-formats
- run: yarn install
- run: yarn run release

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./release/dbm-${{ needs.release.outputs.version }}-windows-x64-nsis-installer.exe
asset_name: dbm-${{ needs.release.outputs.version }}-windows-x64-nsis-installer.exe
asset_content_type: application/octet-stream

- name: Download and upload to qiniu
run: |
wget https://devtools.qiniu.com/qshell-v2.6.2-linux-amd64.tar.gz
tar -xvzf qshell-v2.6.2-linux-amd64.tar.gz
# echo '--------- Start ---------'
# ./qshell account ${{ env.TOKEN_AK }} ${{ env.TOKEN_SK }}
# echo '--------- End ---------'
./qshell account 5eua7TZfgnNb81gmVUBcw4x7PpQuy-v9v1iFyD1R zCwoByIkA9AnlK0qO0DGveH7dKDXLG3CRqZ2mlTW dbm_qiniu
./qshell fput edurtio-other dbm/releases/windows/x64/dbm-${{ needs.release.outputs.version }}-windows-x64-nsis-installer.exe ./release/dbm-${{ needs.release.outputs.version }}-windows-x64-nsis-installer.exe
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
# echo '--------- End ---------'
./qshell account 5eua7TZfgnNb81gmVUBcw4x7PpQuy-v9v1iFyD1R zCwoByIkA9AnlK0qO0DGveH7dKDXLG3CRqZ2mlTW dbm_qiniu
./qshell fput edurtio-other dbm/releases/darwin/x64/dbm-${{ needs.release.outputs.version }}-mac-x64.dmg ./release/dbm-${{ needs.release.outputs.version }}-mac-x64.dmg --overwrite
./qshell fput edurtio-other dbm/releases/darwin/x64/dbm-${{ needs.release.outputs.version }}-mac-x64.zip ./release/dbm-${{ needs.release.outputs.version }}-mac-x64.dmg --overwrite
./qshell fput edurtio-other dbm/releases/darwin/x64/dbm-${{ needs.release.outputs.version }}-mac-x64.zip ./release/dbm-${{ needs.release.outputs.version }}-mac-x64.zip --overwrite
./qshell fput edurtio-other dbm/releases/darwin/x64/latest-mac.yml ./release/latest-mac.yml --overwrite
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/push-compile-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test by push

on:
push

jobs:
build-mac:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Build
uses: actions/setup-node@master
- run: npm cache clear --force
- run: npm install yarn --legacy-peer-deps
- run: yarn add ajv-formats
- run: yarn install
- run: yarn run release

build-win:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Build
uses: actions/setup-node@master
- run: npm cache clear --force
- run: npm install yarn --legacy-peer-deps
- run: yarn add ajv-formats
- run: yarn install
- run: yarn run release

build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Build
uses: actions/setup-node@master
- run: npm cache clear --force
- run: npm install yarn --legacy-peer-deps
- run: yarn add ajv-formats
- run: yarn install
- run: yarn run release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ testem.log
/typings

package-lock.json
yarn.lock

# e2e
/e2e/*.js
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ Basic:

Workflow:

[![Build Status](https://travis-ci.com/EdurtIO/incubator-dbm.svg?branch=master)](https://www.travis-ci.com/github/EdurtIO/incubator-dbm)
[![Test by push](https://github.com/EdurtIO/dbm/actions/workflows/push-compile-test.yml/badge.svg)](https://github.com/EdurtIO/dbm/actions/workflows/push-compile-test.yml)

![example workflow](https://github.com/EdurtIO/dbm/actions/workflows/upload-to-release.yml/badge.svg)
[![Publish New Release](https://github.com/EdurtIO/dbm/actions/workflows/upload-to-release.yml/badge.svg)](https://github.com/EdurtIO/dbm/actions/workflows/upload-to-release.yml)

[![Publish docs via GitHub Pages](https://github.com/EdurtIO/dbm/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/EdurtIO/dbm/actions/workflows/publish-docs.yml)

Development:

Expand Down
125 changes: 125 additions & 0 deletions docs/docs/development/document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
template: overrides/main.html
---

This document describes how to contribute project documents to the repository

#### The preparatory work

---

- Start by [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the project source code into your own repository

- Use the following command to clone the project source code locally

```bash
git clone https://github.com/<UserName>/dbm
```

`UserName`: This is the GitHub username for the current Fork project, like mine **qianmoQ**,So the path is `github.com/qianmoQ/dbm`

#### Install dependencies

---

- Install the mkdocs tool

```bash
pip install mkdocs
```

!!! warning "Warning"

Some devices may require Python and PIP installed!

- Go to the `docs` directory and install project dependencies

```bash
cd docs/

pip install -r requirements.txt
```

#### Local debugging

---

!!! info

Documentation module local debugging is relatively simple. After completing the `install dependencies` section, start the local service using the following command

```bash
mkdocs serve
```

After running the command, information similar to the following is displayed:

```java
INFO - Building documentation...
INFO - The 'extra.alternate' configuration contains a 'link' option that should starts with './' in {'name': 'English', 'link': '/en/', 'lang': 'en'}
INFO - The 'extra.alternate' configuration contains a 'link' option that should starts with './' in {'name': 'Chinese (Simplified)', 'link': '/zh/',
'lang': 'zh'}
WARNING - Language 'zh' is not supported by lunr.js, not setting it in the 'plugins.search.lang' option
INFO - Cleaning site directory
INFO - Translated navigation to en
INFO - Translated navigation to zh
INFO - Building en documentation
INFO - Building zh documentation
INFO - Documentation built in 1.71 seconds
INFO - [14:17:46] Serving on http://127.0.0.1:8000/
```

This marks the successful startup of the service. Open the browser to `http://127.0.0.1:8000/` to see the local site that has been published

#### contribute

---

!!! tip

We recommend that your cloned code rebuild a branch based on the master for code submission<br/>
Build a new branch command `git checkout -b <BranchName>`

- Document Contents

`assets`: Resource files (images, files, etc.)

`development`: Develop relevant documents

`reference`: Software usage related documentation

`release`: Release related documents

- Modify the `mkdocs.yml` configuration file and add the configuration under the `nav` entry

!!! tip

For example, to contribute a test related document, the default file name is `test.md` and the file path is `docs/`

The modified configuration is as follows

```yaml
nav:
...
- Test: docs/test.md
```
- Internationalization name configuration (we'll use the Chinese example), add the configuration under the `nav_translations` entry

```yaml
nav_translations:
zh: # What is marked here is the internationalization configuration of the relevant document
Test: Test
```

- Internationalization document

!!! note

Internationalization documents simply need to add the internationalization abbreviation to the original file, such as our default `test.md`,The internationalization file in Chinese is `test.zh.md`

#### Submit code

---

Once the document is written, we use the `git push` command to submit the written file to a personal repository, and then submit a `Pull request` to the `develop` branch of the remote repository for administrator review. The merge will be automatically posted to the official site
Loading

0 comments on commit 9073179

Please sign in to comment.