chore: 修改构建配置 #14
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 | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
release: | |
name: build and release electron app | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest] | |
# os: [windows-latest, macos-latest, ubuntu-latest] | |
steps: | |
- name: Check out git repository | |
uses: actions/checkout@v4.1.1 | |
- uses: pnpm/action-setup@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install # or pnpm install / yarn install / bun install | |
- name: Build Libs | |
run: pnpm run build | |
- name: Build Electron App | |
run: pnpm electron:build | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
- name: Cleanup Artifacts for Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
npx rimraf "packages/web/dist/electron/!(*.exe)" | |
- name: Cleanup Artifacts for MacOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
npx rimraf "packages/web/dist/electron/!(*.dmg)" | |
- name: upload artifacts | |
uses: actions/upload-artifact@v3.0.0 | |
with: | |
name: ${{ matrix.os }} | |
path: packages/web/dist/electron | |
- name: release | |
uses: softprops/action-gh-release@v2.0.4 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: "packages/web/dist/electron/**" | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} |