-
-
Notifications
You must be signed in to change notification settings - Fork 90
106 lines (92 loc) · 3.13 KB
/
Copy pathrelease.yml
File metadata and controls
106 lines (92 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release Desktop
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
target_tag:
description: 'Release tag'
required: true
default: 'v0.x.x'
run_linux:
description: 'Build for Linux?'
type: boolean
default: true
run_mac:
description: 'Build for macOS?'
type: boolean
default: true
run_win:
description: 'Build for Windows?'
type: boolean
default: true
jobs:
release:
permissions:
contents: write
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check execution logic
id: check
shell: bash
run: |
SHOULD_RUN="false"
if [[ "${{ github.event_name }}" == "push" ]]; then
SHOULD_RUN="true"
else
if [[ "${{ matrix.os }}" == "macos-latest" && "${{ inputs.run_mac }}" == "true" ]]; then SHOULD_RUN="true"; fi
if [[ "${{ matrix.os }}" == "ubuntu-latest" && "${{ inputs.run_linux }}" == "true" ]]; then SHOULD_RUN="true"; fi
if [[ "${{ matrix.os }}" == "windows-latest" && "${{ inputs.run_win }}" == "true" ]]; then SHOULD_RUN="true"; fi
fi
echo "SHOULD_RUN=$SHOULD_RUN" >> $GITHUB_ENV
echo "Decision for ${{ matrix.os }}: $SHOULD_RUN"
- name: Checkout repository
if: env.SHOULD_RUN == 'true'
uses: actions/checkout@v4
- name: Set Release Tag (Manual Workflow Dispatch)
if: env.SHOULD_RUN == 'true' && github.event_name == 'workflow_dispatch'
shell: bash
run: echo "GITHUB_REF=refs/tags/${{ inputs.target_tag }}" >> $GITHUB_ENV
- name: Install pnpm
if: env.SHOULD_RUN == 'true'
uses: pnpm/action-setup@v3
with:
version: 9.15.2
- name: Setup Node.js and cache
if: env.SHOULD_RUN == 'true'
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- name: Install dependencies
if: env.SHOULD_RUN == 'true'
run: pnpm install --frozen-lockfile
- name: Build Main/Renderer
if: env.SHOULD_RUN == 'true'
env:
MAIN_VITE_DISCORD_CLIENT_ID: ${{ secrets.MAIN_VITE_DISCORD_CLIENT_ID }}
run: pnpm electron:build
- name: Build and Release (macOS)
if: env.SHOULD_RUN == 'true' && matrix.os == 'macos-latest'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm ci:build:mac
- name: Build and Release (Windows)
if: env.SHOULD_RUN == 'true' && matrix.os == 'windows-latest'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm ci:build:win
- name: Install Linux dependencies
if: env.SHOULD_RUN == 'true' && matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libfuse2
- name: Build and Release (Linux)
if: env.SHOULD_RUN == 'true' && matrix.os == 'ubuntu-latest'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm ci:build:linux