From 3a05e13948d2e5b8753dbf70f27dae8cd0cf2278 Mon Sep 17 00:00:00 2001 From: muwoo <2424880409@qq.com> Date: Wed, 15 Dec 2021 11:58:11 +0800 Subject: [PATCH] =?UTF-8?q?:construction=5Fworker:=20=E6=94=AF=E6=8C=81git?= =?UTF-8?q?hub=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/FUNDING.yml | 4 ++ .github/ISSUE_TEMPLATE/bug-report.md | 24 ++++++++ .github/ISSUE_TEMPLATE/development-problem.md | 10 ++++ .github/ISSUE_TEMPLATE/feature_request.md | 17 ++++++ .github/workflows/main.yml | 56 +++++++++++++++++++ package.json | 1 + src/main/browsers/runner.ts | 2 +- 7 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/development-problem.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/workflows/main.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..21365ff --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# These are supported funding model platforms + +github: #muwoo +custom: ['https://muwoo.github.io/blogs'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..7f7de61 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,24 @@ +--- +name: Bug report +about: 报告一个bug +title: '' +labels: bug +assignees: '' + +--- + +**描述一下这个bug** +清楚而简洁地描述了错误是什么 + +**复现方式** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**预期行为** +清晰简明地描述了您预期的发生。 + +**截图** +如果可以,请添加屏幕截图以帮助解释您的问题。 diff --git a/.github/ISSUE_TEMPLATE/development-problem.md b/.github/ISSUE_TEMPLATE/development-problem.md new file mode 100644 index 0000000..140e48d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/development-problem.md @@ -0,0 +1,10 @@ +--- +name: Development Problem +about: 任何开发建议、使用问题、交流学习都可以 +title: '' +labels: help wanted +assignees: '' + +--- + +## 任何开发建议、交流学习都可以 diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..a7e39dd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: 提交一个新特性/功能 +title: '' +labels: feature +assignees: '' + +--- + +**您的功能请求是否与问题相关? 请简单描述.** +清晰简明地描述问题是什么. Ex. I'm always frustrated when [...] + +**请描述一下您想要的解决方案** +清晰简明地描述您想要发生的事情。 + +**描述你考虑过的替代方案** +清晰简洁地描述您所考虑的任何替代解决方案或功能。 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9120f78 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,56 @@ +# main.yml + +# Workflow's name +name: Build + +# Workflow's trigger +on: + push: + branches: + - master + +# Workflow's jobs +jobs: + # job's id + release: + # job's name + name: build and release electron app + + # the type of machine to run the job on + runs-on: ${{ matrix.os }} + + # create a build matrix for jobs + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-2019] + + # create steps + steps: + # step1: check out repository + - name: Check out git repository + uses: actions/checkout@v2 + + # step2: install node env + - name: Install Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + + - name: Install system deps + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get install libxtst-dev libpng++-dev + sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils + # step3: yarn + - name: macos Yarn install + if: ${{runner.os == 'macOS'}} + run: | + yarn + yarn global add xvfb-maybe + + - name: Build & release app + run: | + npm run release + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/package.json b/package.json index ffb6412..c3ea844 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "feature:dev": "cd feature & npm run serve", "electron:build": "vue-cli-service electron:build", "electron:serve": "vue-cli-service electron:serve", + "release": "vue-cli-service electron:serve", "postinstall": "electron-builder install-app-deps", "postuninstall": "electron-builder install-app-deps" }, diff --git a/src/main/browsers/runner.ts b/src/main/browsers/runner.ts index 1848f27..d8c2e29 100644 --- a/src/main/browsers/runner.ts +++ b/src/main/browsers/runner.ts @@ -48,7 +48,7 @@ export default () => { view.setBounds({ x: 0, y: 60, width: 800, height: 600 }); view.setAutoResize({ width: true }); window.setSize(800, 660); - view.webContents.openDevTools(); + commonConst.dev() && view.webContents.openDevTools(); executeHooks("PluginEnter", plugin.ext); executeHooks("PluginReady", plugin.ext); window.webContents.executeJavaScript(`window.pluginLoaded()`);