Skip to content

Commit 9ff5dca

Browse files
committed
ci: build channel
1 parent f135ec6 commit 9ff5dca

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
ELECTRON_BUILDER_HTTP_TIMEOUT: 6000000
1313
ELECTRON_MIRROR: 'https://npmmirror.com/mirrors/electron/'
1414
GH_TOKEN: ${{ secrets.TOKEN }}
15+
USE_HARD_LINKS: false
16+
ELECTRON_BUILDER_RELEASE_ID: ${{ github.ref }}_${{ github.sha }}
1517
strategy:
1618
matrix:
1719
include:
@@ -123,10 +125,29 @@ jobs:
123125
# 更新 package.json 添加构建信息
124126
node scripts/inject-build-info.js
125127
128+
# 设置环境变量
129+
- name: Set env
130+
run: echo "GH_RELEASE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
131+
shell: bash
132+
133+
# 为 MacOS ARM64 任务设置创建发布标志
134+
- name: Set create release flag for first job
135+
if: matrix.os == 'macos-latest' && matrix.arch == 'arm64'
136+
run: echo "SHOULD_CREATE_RELEASE=true" >> $GITHUB_ENV
137+
shell: bash
138+
139+
# 为其他任务设置更新发布标志
140+
- name: Set update release flag for other jobs
141+
if: matrix.os != 'macos-latest' || matrix.arch != 'arm64'
142+
run: echo "SHOULD_CREATE_RELEASE=false" >> $GITHUB_ENV
143+
shell: bash
144+
126145
# 构建应用程序
127146
- name: Build/release Electron app - macOS
128147
uses: samuelmeuli/action-electron-builder@v1.6.0
129148
if: startsWith(matrix.os, 'macos')
149+
env:
150+
ELECTRON_BUILDER_CREATE_RELEASE: ${{ env.SHOULD_CREATE_RELEASE }}
130151
with:
131152
args: ${{ matrix.build_args }}
132153
github_token: ${{ secrets.TOKEN }}
@@ -138,6 +159,7 @@ jobs:
138159
env:
139160
CUDA_VERSION: ${{ matrix.cuda_version }}
140161
CUDA_OPT: ${{ matrix.cuda_opt }}
162+
ELECTRON_BUILDER_CREATE_RELEASE: ${{ env.SHOULD_CREATE_RELEASE }}
141163
with:
142164
github_token: ${{ secrets.TOKEN }}
143165
release: ${{ startsWith(github.ref, 'refs/tags/v') }}

0 commit comments

Comments
 (0)