feat: 🚀 添加初步的构建及发布支持

This commit is contained in:
viarotel 2023-09-16 23:39:38 +08:00
parent 9ef720383e
commit c85f8fb187
6 changed files with 129 additions and 4 deletions

20
.github/workflows/release-please.yml vendored Normal file
View File

@ -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 }}

56
.github/workflows/release.yml vendored Normal file
View File

@ -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 }}

20
.github/workflows/sync-gitee.yml vendored Normal file
View File

@ -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

21
.vscode/settings.json vendored
View File

@ -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]": { "[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },

View File

@ -12,11 +12,19 @@ asarUnpack:
- resources/** - resources/**
win: win:
executableName: escrcpy executableName: escrcpy
target:
- target: nsis
arch: [ia32, x64]
- zip
- portable
nsis: nsis:
artifactName: ${name}-${version}-setup.${ext} artifactName: ${productName}-${version}-setup.${ext}
shortcutName: ${productName} shortcutName: ${productName}
uninstallDisplayName: ${productName} uninstallDisplayName: ${productName}
createDesktopShortcut: always createDesktopShortcut: always
portable:
artifactName: '${productName}-${version}-portable.${ext}'
requestExecutionLevel: user
mac: mac:
entitlementsInherit: build/entitlements.mac.plist entitlementsInherit: build/entitlements.mac.plist
extendInfo: extendInfo:

View File

@ -1,10 +1,10 @@
{ {
"name": "escrcpy", "name": "escrcpy",
"version": "0.0.0", "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", "main": "./out/main/index.js",
"author": "example.com",
"homepage": "https://www.electronjs.org",
"scripts": { "scripts": {
"format": "prettier --write .", "format": "prettier --write .",
"lint": "eslint . --ext .md,.vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .eslintignore --fix", "lint": "eslint . --ext .md,.vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .eslintignore --fix",