-
-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (76 loc) · 2.63 KB
/
release.yml
File metadata and controls
89 lines (76 loc) · 2.63 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
# ByteBox - Release Build Workflow
# Made with ❤️ by Pink Pixel
#
# Triggers on any tag that looks like a version: v2.4.0, v3.0.0-beta.1, etc.
# Can also be triggered manually via workflow_dispatch.
#
# Produces:
# • Windows → NSIS installer (.exe) — built on windows-latest
#
# Linux builds (AppImage + .deb) are built locally and uploaded manually.
#
# Create a release like this to trigger it:
# git tag v2.4.0 && git push origin v2.4.0
# (then create the Release on GitHub, or use the gh CLI)
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Release tag to upload to (e.g. v2.4.0)"
required: true
permissions:
contents: write # needed to upload release assets
jobs:
# ── Windows installer (.exe) ────────────────────────────────────────────────
build-windows:
name: Windows installer
runs-on: windows-latest
# Use bash for all run steps — the npm scripts in package.json use
# Unix pipes (grep) that break under cmd.exe / PowerShell.
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Generate Prisma client
env:
DATABASE_URL: "file:./dev.db"
run: npx prisma generate
# Run next build directly instead of `npm run build` — the npm script
# pipes through `grep` which can fail on Windows even under bash.
# The env vars below replicate what scripts/next-with-env.cjs sets.
- name: Build Next.js
env:
DATABASE_URL: "file:./dev.db"
NEXT_TELEMETRY_DISABLED: "1"
NODE_ENV: production
PORT: "1334"
BROWSERSLIST_IGNORE_OLD_DATA: "1"
BASELINE_BROWSER_MAPPING_IGNORE_OLD_DATA: "1"
run: npx next build
- name: Compile Electron main process
run: npm run electron:compile
- name: Package Windows installer
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx electron-builder --win --publish never
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }}
files: release/**/*.exe
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}