diff --git a/.github/workflows/ReleaseBuild.yml b/.github/workflows/ReleaseBuild.yml new file mode 100644 index 0000000..6bbb52d --- /dev/null +++ b/.github/workflows/ReleaseBuild.yml @@ -0,0 +1,52 @@ +name: Release Build +on: + push: + tags: + - 'v*' +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [10.x] + node-registry: ['https://registry.npmjs.org'] + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + registry-url: ${{ matrix.node-registry }} + - name: npm install, build, and test + run: | + npm install + npm test --if-present + npm run electron:build + - name: Create Release + id: create_release + uses: actions/create-release@v1.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload Release Asset For Win + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./stream-downloader.exe + asset_name: stream-downloader-winx64.exe + asset_content_type: application/vnd.microsoft.portable-executable + - name: Upload Release Asset For Linux + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./dist_electron/微采助手 Setup 0.1.0.exe + asset_name: 微采助手-Setup + asset_content_type: application/x-executable \ No newline at end of file diff --git a/package.json b/package.json index 7a5e7ad..9628e82 100644 --- a/package.json +++ b/package.json @@ -39,10 +39,10 @@ "child_process": "^1.0.2", "colorful": "^2.1.0", "cron": "^1.7.2", - "electron": "^6.0.7", "express": "^4.17.1", "express-ws": "^4.0.0", "fast-json-stringify": "^1.15.6", + "ffi-napi": "^2.4.5", "fs-extra": "^8.1.0", "iconv-lite": "^0.5.0", "inquirer": "^7.0.0", @@ -79,6 +79,8 @@ "@vue/test-utils": "1.0.0-beta.29", "babel-eslint": "^10.0.1", "chai": "^4.1.2", + "electron": "^6.0.10", + "electron-builder": "^21.2.0", "eslint": "^5.16.0", "eslint-friendly-formatter": "^4.0.1", "eslint-plugin-vue": "^5.0.0", @@ -89,4 +91,4 @@ "vue-template-compiler": "^2.6.10" }, "__npminstall_done": false -} \ No newline at end of file +}