Skip to content

Commit

Permalink
chore(build.yml): Update workflow to build and release Electron app
Browse files Browse the repository at this point in the history
  • Loading branch information
HashCookie committed May 26, 2024
1 parent d17deef commit 51e03f9
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 构建并发布 Electron 应用
name: Build and Release Electron App

on:
push:
Expand All @@ -12,25 +12,21 @@ jobs:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: 检出代码
- name: Check out code
uses: actions/checkout@v2

- name: 设置 Node.js
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18' # 更新到 Node.js 18
node-version: '18' # 使用 Node.js 18

- name: 安装 snapcraft(仅 Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo snap install snapcraft --classic

- name: 安装依赖
- name: Install dependencies
run: yarn install

- name: 构建 Electron 应用
- name: Build Electron app
run: yarn dist

- name: 上传构建产物
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: electron-app-${{ matrix.os }}
Expand All @@ -40,33 +36,33 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- name: 下载 macOS 构建产物
- name: Download macOS build artifacts
uses: actions/download-artifact@v2
with:
name: electron-app-macos-latest

- name: 下载 Ubuntu 构建产物
- name: Download Ubuntu build artifacts
uses: actions/download-artifact@v2
with:
name: electron-app-ubuntu-latest

- name: 下载 Windows 构建产物
- name: Download Windows build artifacts
uses: actions/download-artifact@v2
with:
name: electron-app-windows-latest

- name: 创建 GitHub 发布
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: 发布 ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: 上传发布资源
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down

0 comments on commit 51e03f9

Please sign in to comment.