使用github actions构建多平台electron应用
创始人
2024-12-26 01:04:18
0

1. 创建electron项目

使用pnpm创建项目

pnpm create @quick-start/electron

2. 修改electron-builder.yml文件

修改mac的target

mac:   target:     - target: dmg       arch: universal

3. 添加workflow

创建 .github/workflows/main.yml 文件

name: Build/release Electron app  on:   workflow_dispatch:  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: 20        - 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 }}

 提交代码到git仓库

4. 构建项目

创建一个github token

https://github.com/settings/tokens

创建token并复制备用

在仓库settings中添加密钥

在仓库actions中执行 run workflow

构建成功后在releases中可以看到

相关内容

热门资讯

5分钟新号!wepoker游戏... 5分钟新号!wepoker游戏下载,wejoker私人辅助软件,详细教程(有挂外 挂);1)wejo...
十分钟俱乐部辅助!wpk系统是... 十分钟俱乐部辅助!wpk系统是否存在作弊行为(透视辅助)详细辅助助手(本来真的是有挂)1、下载好辅助...
五分钟控制牌!hhpoker德... 五分钟控制牌!hhpoker德州有挂吗(透视脚本)详细辅助模拟器(其实真的有挂)1、透视辅助简单,软...
四分钟插件!aapoker发牌... 四分钟插件!aapoker发牌逻辑(透视辅助)详细辅助方法(竟然是真的有挂)aapoker发牌逻辑辅...
8分钟辅助挂!wejoker辅... 8分钟辅助挂!wejoker辅助器要钱玩吗(透视底牌)详细辅助插件(本来真的有挂);1、系统规律教程...
3分钟辅助软件!wpk作弊,w... 3分钟辅助软件!wpk作弊,wpk作弊,详细教程(有挂攻略);1、不需要AI权限,帮助你快速的进行w...
9分钟买挂!hhpoker德州... 9分钟买挂!hhpoker德州作弊(透视脚本)详细辅助助手(原来真的是有挂)暗藏猫腻,小编详细说明h...
五分钟透视方法!aapoker... 五分钟透视方法!aapoker俱乐部靠谱吗,aapoker破解侠是真的吗,详细教程(有挂技巧)1、进...
4分钟正规!wepoker高级... 4分钟正规!wepoker高级辅助,wepoker俱乐部辅助,详细教程(有挂工具)1、每一步都需要思...
5分钟辅助器!wpk官网下载链... 5分钟辅助器!wpk官网下载链接(透视辅助)详细辅助作弊(果然有挂)进入游戏-大厅左侧-新手福利-激...