diff --git a/.github/workflows/build-electron.yaml b/.github/workflows/build-electron.yaml new file mode 100644 index 00000000..51d5a52a --- /dev/null +++ b/.github/workflows/build-electron.yaml @@ -0,0 +1,35 @@ +name: Build/release + +on: + push: + tags: + - 'v*.*.*' # 只在 tag push 时触发工作流 + +jobs: + release: + permissions: write-all + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + steps: + - name: Check out Git repository + uses: actions/checkout@v1 + + - name: Install Node.js, NPM and Yarn + uses: actions/setup-node@v1 + with: + node-version: 20 + + - name: Build/release Electron app + uses: Yan-Jobs/action-electron-builder@v1.7.0 + with: + # GitHub token, automatically provided to the action + # (No need to define this secret in the repo settings) + github_token: ${{ secrets.github_token }} + # If the commit is tagged with a version (e.g. "v1.0.0"), + # release the app after building + release: ${{ startsWith(github.ref, 'refs/tags/v') }} + build_script_name: build:electron diff --git a/package.json b/package.json index 8f220137..65226940 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coss-client", - "version": "0.0.0", + "version": "1.0.0", "type": "module", "description": "coss 及时通讯的客户端", "keywords": [ @@ -25,6 +25,7 @@ "build": "tsc && vite build", "build:electron": "tsc && vite build -c vite.electron.config.ts && electron-builder", "build:mobile": "npm run build && npx cap sync", + "build:action": "tsc && vite build -c vite.electron.config.ts", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", "translate": "node node_modules/vue-auto-translate/server.js",