deploy: add github action yaml #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Electron App Release Workflow | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build-and-publish: | |
runs-on: windows-2022 # 或选择其他适合你项目的操作系统环境 | |
env: | |
GITHUB_TOKEN: ${{ vars.REPO_NOEXPIRATION }} | |
ELECTRON_MIRROR: https://npmmirror.com/mirrors/electron/ | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Install Node.js and npm | |
uses: actions/[email protected] | |
with: | |
node-version: "18.18.1" # 使用与你的项目兼容的Node.js版本 | |
- name: Install dependencies and rebuild native modules for Electron | |
run: npm ci | |
- name: Publish to GitHub Release using electron-builder | |
run: npm run publish # 这个命令将在本地运行electron-builder的发布流程,包括构建和发布到GitHub |