From c85f8fb187c3f2d86c2f709e7aee839e74dfe090 Mon Sep 17 00:00:00 2001 From: viarotel Date: Sat, 16 Sep 2023 23:39:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=9A=80=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=9D=E6=AD=A5=E7=9A=84=E6=9E=84=E5=BB=BA=E5=8F=8A=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-please.yml | 20 ++++++++++ .github/workflows/release.yml | 56 ++++++++++++++++++++++++++++ .github/workflows/sync-gitee.yml | 20 ++++++++++ .vscode/settings.json | 21 +++++++++++ electron-builder.yml | 10 ++++- package.json | 6 +-- 6 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release-please.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/sync-gitee.yml diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..5ddc8b99 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,20 @@ +name: release-please + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + with: + release-type: node + package-name: release-please-action + token: ${{ secrets.ACCESS_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..0a410add --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,56 @@ +name: Build/release Electron app + +on: + push: + tags: + - v*.*.* + +jobs: + release: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + steps: + - name: Check out Git repository + uses: actions/checkout@v3 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install Dependencies + run: npm install + + - name: build-linux + if: matrix.os == 'ubuntu-latest' + run: npm run build:linux + + - name: build-mac + if: matrix.os == 'macos-latest' + run: npm run build:mac + + - name: build-win + if: matrix.os == 'windows-latest' + run: npm run build:win + + - name: release + uses: softprops/action-gh-release@v1 + with: + draft: true + files: | + dist/*.exe + dist/*.zip + dist/*.dmg + dist/*.AppImage + dist/*.snap + dist/*.deb + dist/*.rpm + dist/*.tar.gz + dist/*.yml + dist/*.blockmap + env: + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} diff --git a/.github/workflows/sync-gitee.yml b/.github/workflows/sync-gitee.yml new file mode 100644 index 00000000..4239b9c7 --- /dev/null +++ b/.github/workflows/sync-gitee.yml @@ -0,0 +1,20 @@ +name: Sync To Gitee +on: + workflow_dispatch: {} + push: + branches: + - main +jobs: + sync-to-gitee: + runs-on: ubuntu-latest + steps: + - name: gitee-mirror-action + uses: Yikun/hub-mirror-action@master + with: + src: github/viarotel-org + dst: gitee/viarotel-org + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} + dst_token: ${{ secrets.GITEE_TOKEN }} + account_type: org + white_list: 'escrcpy' + force_update: true diff --git a/.vscode/settings.json b/.vscode/settings.json index 4c05394e..47cca10e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,25 @@ { + "editor.formatOnSave": false, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true, + "source.organizeImports": false + }, + "eslint.format.enable": true, + "eslint.codeAction.showDocumentation": { + "enable": true + }, + "eslint.validate": [ + // "jsonc", + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "html", + "markdown", + "json", + "yaml" + ], "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, diff --git a/electron-builder.yml b/electron-builder.yml index d23049c2..de7c705f 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -12,11 +12,19 @@ asarUnpack: - resources/** win: executableName: escrcpy + target: + - target: nsis + arch: [ia32, x64] + - zip + - portable nsis: - artifactName: ${name}-${version}-setup.${ext} + artifactName: ${productName}-${version}-setup.${ext} shortcutName: ${productName} uninstallDisplayName: ${productName} createDesktopShortcut: always +portable: + artifactName: '${productName}-${version}-portable.${ext}' + requestExecutionLevel: user mac: entitlementsInherit: build/entitlements.mac.plist extendInfo: diff --git a/package.json b/package.json index c56c85b3..7df89f94 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "escrcpy", "version": "0.0.0", - "description": "An Electron application with Vue", + "description": "Scrcpy Powered by Electron", + "author": "viarotel", + "homepage": "https://github.com/viarotel-org/escrcpy", "main": "./out/main/index.js", - "author": "example.com", - "homepage": "https://www.electronjs.org", "scripts": { "format": "prettier --write .", "lint": "eslint . --ext .md,.vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .eslintignore --fix",