-
Notifications
You must be signed in to change notification settings - Fork 2
192 lines (166 loc) · 5.42 KB
/
release.yaml
File metadata and controls
192 lines (166 loc) · 5.42 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: Release Electron App
on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g., 1.0.0)"
required: true
draft:
description: "Create as draft release"
type: boolean
default: true
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
determine-version:
name: Determine Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
is_draft: ${{ steps.get_version.outputs.is_draft }}
steps:
- name: Determine version
id: get_version
run: |
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
echo "is_draft=${{ github.event.inputs.draft }}" >> $GITHUB_OUTPUT
create-draft-release:
name: Create Draft Release
needs: determine-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create release
shell: bash
run: |
DRAFT_FLAG=""
if [ "${{ needs.determine-version.outputs.is_draft }}" = "true" ]; then
DRAFT_FLAG="--draft"
fi
gh release create v${{ needs.determine-version.outputs.version }} \
--title "Control Station v${{ needs.determine-version.outputs.version }}" \
--generate-notes \
$DRAFT_FLAG
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-frontend:
name: Build Frontend
needs: determine-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.26.0
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build with Turbo
run: pnpm turbo build --filter=testing-view
- uses: actions/upload-artifact@v4
with:
name: frontend-dist
path: frontend/testing-view/dist/**
retention-days: 1
build-backend:
name: Build Backend - ${{ matrix.os }}
needs: determine-version
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: windows-latest
binary: backend-windows-amd64.exe
goarch: amd64
- os: ubuntu-latest
binary: backend-linux-amd64
goarch: amd64
- os: macos-latest
binary: backend-darwin-arm64
goarch: arm64
- os: macos-15-intel
binary: backend-darwin-amd64
goarch: amd64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
- name: Install Linux deps
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y gcc
- name: Build backend binary
working-directory: backend/cmd
shell: bash
run: go build -o ../../electron-app/binaries/${{ matrix.binary }} .
env:
CGO_ENABLED: 1
GOARCH: ${{ matrix.goarch }}
- uses: actions/upload-artifact@v4
with:
name: backend-${{ matrix.os }}
path: electron-app/binaries/${{ matrix.binary }}
retention-days: 1
package-and-upload:
name: Package & Upload - ${{ matrix.os }}
needs: [determine-version, create-draft-release, build-frontend, build-backend]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: windows-latest
binary: backend-windows-amd64.exe
- os: ubuntu-latest
binary: backend-linux-amd64
- os: macos-latest
binary: backend-darwin-arm64
- os: macos-15-intel
binary: backend-darwin-amd64
steps:
- uses: actions/checkout@v4
- name: Download backend binary
uses: actions/download-artifact@v4
with:
name: backend-${{ matrix.os }}
path: electron-app/binaries
- name: Set executable permissions (Unix)
if: runner.os != 'Windows'
run: chmod +x electron-app/binaries/*
- name: Download frontend dist
uses: actions/download-artifact@v4
with:
name: frontend-dist
path: electron-app/renderer/testing-view
- uses: pnpm/action-setup@v4
with:
version: 10.26.0
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Update version in package.json
working-directory: electron-app
shell: bash
run: pnpm version ${{ needs.determine-version.outputs.version }} --no-git-tag-version
- name: Install Electron dependencies
working-directory: electron-app
run: pnpm install
- name: Build Electron distribution
working-directory: electron-app
run: pnpm run dist
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_IDENTITY_AUTO_DISCOVERY: false
ELECTRON_BUILDER_PUBLISH: never
- name: Upload to GitHub Release
shell: bash
run: |
find electron-app/dist -maxdepth 1 -type f \
\( -name "*.exe" -o -name "*.AppImage" -o -name "*.deb" \
-o -name "*.dmg" -o -name "*.zip" -o -name "*.yml" -o -name "*.blockmap" \) \
| xargs gh release upload v${{ needs.determine-version.outputs.version }} --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}