-
Notifications
You must be signed in to change notification settings - Fork 1
162 lines (138 loc) · 5.11 KB
/
release_desktop_app.yml
File metadata and controls
162 lines (138 loc) · 5.11 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Release Desktop App
on:
# Keep existing manual trigger for backwards compatibility
workflow_dispatch:
inputs:
build_type:
description: "Build Type"
required: true
type: choice
options:
- windows-latest
- macos-latest
- ubuntu-latest
default: windows-latest
# NEW: Add workflow_call for reusability
workflow_call:
inputs:
platform:
description: 'Platform to build'
required: true
type: string # windows-latest, macos-latest, ubuntu-latest
build_variant:
description: 'Build variant'
required: false
type: string
default: 'production'
custom_url:
description: 'Custom app URL (overrides production/beta)'
required: false
type: string
default: ''
git_ref:
description: 'Git ref to checkout'
required: false
type: string
default: ''
checkout_branch:
description: 'Specific branch to checkout (e.g., draft-linux-fixes)'
required: false
type: string
default: ''
outputs:
artifacts:
description: 'Build artifacts paths'
value: ${{ jobs.release.outputs.artifacts }}
jobs:
release:
env:
EP_GH_IGNORE_TIME: true
# Set environment variables based on inputs
BUILD_VARIANT: ${{ inputs.build_variant || (inputs.custom_url && 'custom') || 'production' }}
DESKTOP_APP_URL: ${{ inputs.custom_url || (inputs.build_variant == 'beta' && 'https://beta.requestly.io') || 'https://app.requestly.io' }}
DISABLE_AUTO_UPDATE: ${{ (inputs.custom_url != '' || inputs.build_variant == 'beta') && 'true' || 'false' }}
runs-on: ${{ inputs.platform || github.event.inputs.build_type }}
outputs:
artifacts: ${{ steps.output.outputs.paths }}
steps:
- name: EOL autocrlf input
if: ${{ (inputs.platform || github.event.inputs.build_type) != 'windows-latest' }}
run: git config --global core.autocrlf input
- name: EOL autocrlf true
if: ${{ (inputs.platform || github.event.inputs.build_type) == 'windows-latest' }}
run: git config --global core.autocrlf true
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout_branch || inputs.git_ref || github.ref }}
- name: Setup Python for node-gyp (macOS only)
if: ${{ (inputs.platform || github.event.inputs.build_type) == 'macos-latest' }}
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install setuptools for node-gyp (macOS only)
if: ${{ (inputs.platform || github.event.inputs.build_type) == 'macos-latest' }}
run: |
python -m pip install --upgrade pip
python -m pip install setuptools
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 20.9.0
cache: 'npm'
- name: Install desktop app dependencies
run: bash ./install.sh
- name: Build Electron app
run: npm run build
- name: Package Electron app
uses: samuelmeuli/action-electron-builder@v1.6.0
with:
github_token: ${{ secrets.publish_token }}
package_root: "."
mac_certs: ${{ secrets.mac_certs }}
mac_certs_password: ${{ secrets.mac_certs_password }}
windows_certs: ${{ secrets.windows_certs }}
windows_certs_password: ${{ secrets.windows_certs_password }}
release: false # Don't publish automatically - orchestrator handles releases
skip_build: true # We already built in previous step - just package
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
- name: List build outputs
if: always()
shell: bash
run: |
echo "Build outputs:"
ls -lh release/build/ 2>/dev/null || echo "No build directory found"
- name: Upload macOS artifacts
if: always() && (inputs.platform || github.event.inputs.build_type) == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: macos-build
path: |
release/build/*.dmg
release/build/*.zip
retention-days: 30
if-no-files-found: warn
- name: Upload Windows artifacts
if: always() && (inputs.platform || github.event.inputs.build_type) == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: windows-build
path: |
release/build/*.exe
retention-days: 30
if-no-files-found: warn
- name: Upload Linux artifacts
if: always() && (inputs.platform || github.event.inputs.build_type) == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: linux-build
path: |
release/build/*.AppImage
retention-days: 30
if-no-files-found: warn
- name: Set artifact output
id: output
run: |
echo "paths=release/build/*" >> $GITHUB_OUTPUT