Skip to content

Commit bf77489

Browse files
authored
Merge pull request #6 from AutoCookies/v0.4.0-beta
V0.4.0 beta
2 parents 0df9284 + c191faa commit bf77489

File tree

182 files changed

+105475
-2599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+105475
-2599
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Global owner — all PRs require review from the repo owner
2+
* @AutoCookies

.github/workflows/README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# SyntaxVoid CI/CD Workflows
2+
3+
## Workflows
4+
5+
### `ci.yml` — Continuous Integration
6+
Runs on every push/PR to `main`, `master`, or `dev`.
7+
8+
- **Smoke check** on Linux, Windows, macOS: installs deps + builds native modules
9+
- **ESLint** lint pass
10+
11+
### `build.yml` — Build & Release
12+
Runs when you push a version tag (`v1.2.3`) or manually dispatch.
13+
14+
Produces downloadable artifacts for every platform:
15+
16+
| Platform | Artifacts |
17+
|---|---|
18+
| Linux x64 | `.AppImage`, `.deb`, `.rpm`, `.tar.gz` |
19+
| Linux ARM64 | `.AppImage`, `.deb`, `.rpm`, `.tar.gz` |
20+
| Windows x64 | `.exe` (NSIS installer), `.zip` |
21+
| macOS Universal | `.dmg`, `.zip` |
22+
23+
---
24+
25+
## How to create a release
26+
27+
```bash
28+
# 1. Bump the version in package.json
29+
npm version 1.2.3 # or manually edit
30+
31+
# 2. Commit and tag
32+
git add package.json
33+
git commit -m "chore: release v1.2.3"
34+
git tag v1.2.3
35+
36+
# 3. Push — this triggers the build workflow
37+
git push origin main --tags
38+
```
39+
40+
GitHub Actions will:
41+
1. Build SyntaxVoid on all 4 platform runners in parallel
42+
2. Collect all `.AppImage`, `.deb`, `.rpm`, `.tar.gz`, `.exe`, `.zip`, `.dmg` files
43+
3. Create a GitHub Release at `https://github.com/AutoCookies/syntaxvoid/releases/tag/v1.2.3`
44+
4. Attach all files as downloadable assets
45+
46+
---
47+
48+
## Optional: macOS Code Signing
49+
50+
Without signing, macOS users see a Gatekeeper warning. To enable signing,
51+
add these **repository secrets** (Settings → Secrets → Actions):
52+
53+
| Secret | Value |
54+
|---|---|
55+
| `MACOS_CERT_P12` | Base64-encoded `.p12` Developer ID certificate |
56+
| `MACOS_CERT_PASSWORD` | Password for the `.p12` |
57+
| `APPLE_ID` | Your Apple ID email |
58+
| `APPLE_APP_PASSWORD` | App-specific password from appleid.apple.com |
59+
| `APPLE_TEAM_ID` | Your Apple Developer Team ID |
60+
61+
Without these secrets, the workflow produces **unsigned builds** that still
62+
work — users just need to right-click → Open on first launch.
63+
64+
---
65+
66+
## Pre-release / canary builds
67+
68+
Tags with a pre-release suffix are automatically marked as pre-releases:
69+
70+
```bash
71+
git tag v1.2.3-beta.1
72+
git push origin v1.2.3-beta.1
73+
```
74+
75+
To build a **SyntaxVoidNext** (canary) package that runs alongside stable:
76+
77+
1. Go to **Actions → Build & Release → Run workflow**
78+
2. Set `channel` to `next`

.github/workflows/build.yml

Lines changed: 301 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,301 @@
1+
name: Build & Release
2+
3+
# Triggers:
4+
# 1. Push a version tag → full build + public GitHub Release
5+
# 2. Manual trigger → build without publishing (for testing the pipeline)
6+
on:
7+
push:
8+
tags:
9+
- 'v[0-9]+.[0-9]+.[0-9]+' # stable: v1.2.3
10+
- 'v[0-9]+.[0-9]+.[0-9]+-*' # pre-rel: v1.2.3-beta.1
11+
workflow_dispatch:
12+
inputs:
13+
channel:
14+
description: 'Release channel'
15+
required: true
16+
default: 'regular'
17+
type: choice
18+
options:
19+
- regular # standard SyntaxVoid build
20+
- next # SyntaxVoidNext (canary) — runs alongside stable
21+
22+
# Only one release job runs at a time per tag.
23+
concurrency:
24+
group: release-${{ github.ref }}
25+
cancel-in-progress: false
26+
27+
jobs:
28+
# ────────────────────────────────────────────────────────────────────────
29+
# Build Matrix — one runner per platform
30+
# ────────────────────────────────────────────────────────────────────────
31+
build:
32+
name: Build · ${{ matrix.name }}
33+
runs-on: ${{ matrix.runner }}
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
include:
38+
39+
# ── Linux (x64) ──────────────────────────────────────────────────
40+
- name: Linux x64
41+
runner: ubuntu-latest
42+
platform: linux
43+
arch: x64
44+
artifact_name: syntaxvoid-linux
45+
artifact_glob: |
46+
dist/*.AppImage
47+
dist/*.deb
48+
dist/*.rpm
49+
dist/*.tar.gz
50+
51+
# ── Linux (ARM64) — cross-compiled on x64 runner ─────────────────
52+
- name: Linux ARM64
53+
runner: ubuntu-latest
54+
platform: linux
55+
arch: arm64
56+
artifact_name: syntaxvoid-linux-arm64
57+
artifact_glob: |
58+
dist/*.AppImage
59+
dist/*.deb
60+
dist/*.rpm
61+
dist/*.tar.gz
62+
63+
# ── Windows (x64) ────────────────────────────────────────────────
64+
- name: Windows x64
65+
runner: windows-latest
66+
platform: win
67+
arch: x64
68+
artifact_name: syntaxvoid-windows
69+
artifact_glob: |
70+
dist/*.exe
71+
dist/*.zip
72+
73+
# ── macOS (Universal: Intel + Apple Silicon) ──────────────────────
74+
- name: macOS Universal
75+
runner: macos-latest
76+
platform: mac
77+
arch: universal
78+
artifact_name: syntaxvoid-macos
79+
artifact_glob: |
80+
dist/*.dmg
81+
dist/*.zip
82+
83+
steps:
84+
# ── Checkout ──────────────────────────────────────────────────────────
85+
- name: Checkout
86+
uses: actions/checkout@v4
87+
with:
88+
fetch-depth: 0 # full history so electron-builder can read git tags
89+
90+
# ── Node.js ───────────────────────────────────────────────────────────
91+
- name: Set up Node.js 20
92+
uses: actions/setup-node@v4
93+
with:
94+
node-version: '20'
95+
cache: 'yarn'
96+
97+
- name: Enable Corepack (Yarn)
98+
run: corepack enable
99+
100+
# ── Linux: install system dependencies ────────────────────────────────
101+
# NOTE: Ubuntu 24.04 (Noble) renamed libasound2 → libasound2t64
102+
- name: Install Linux build deps
103+
if: matrix.platform == 'linux'
104+
run: |
105+
sudo apt-get update -y
106+
sudo apt-get install -y \
107+
libx11-dev libxkbfile-dev libsecret-1-dev \
108+
rpm fakeroot dpkg libnss3 libatk1.0-0 \
109+
libatk-bridge2.0-0 libgdk-pixbuf2.0-0 \
110+
libgtk-3-0 libgbm1 libasound2t64
111+
112+
# ── macOS: import code-signing certificate (optional) ─────────────────
113+
# Set the following repository secrets to enable code-signing:
114+
# MACOS_CERT_P12 base64-encoded .p12 certificate
115+
# MACOS_CERT_PASSWORD password for the .p12
116+
# APPLE_ID Apple ID email (for notarization)
117+
# APPLE_APP_PASSWORD App-specific password
118+
# APPLE_TEAM_ID Apple Developer Team ID
119+
- name: Import macOS signing certificate
120+
if: matrix.platform == 'mac' && env.MACOS_CERT_P12 != ''
121+
env:
122+
MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
123+
MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}
124+
run: |
125+
echo "$MACOS_CERT_P12" | base64 --decode > certificate.p12
126+
security create-keychain -p ci_keychain build.keychain
127+
security default-keychain -s build.keychain
128+
security unlock-keychain -p ci_keychain build.keychain
129+
security import certificate.p12 -k build.keychain \
130+
-P "$MACOS_CERT_PASSWORD" -T /usr/bin/codesign
131+
security set-key-partition-list -S apple-tool:,apple: \
132+
-s -k ci_keychain build.keychain
133+
rm certificate.p12
134+
135+
# ── Set up crabpm (SyntaxVoid package manager) ────────────────────────
136+
# Cloned into `ppm/` — the path the build script expects.
137+
#
138+
# Linux / Windows: normal install works fine.
139+
#
140+
# macOS: git-utils (a crabpm dependency) bundles an old libgit2/zlib that
141+
# redefines the `fdopen` macro, which conflicts with Xcode 16+ SDK headers.
142+
# We skip all native-module compilation with --ignore-scripts and then run
143+
# the postinstall script manually so the bundled Node binary is still
144+
# downloaded. crabpm's git integration is not needed for CI builds.
145+
- name: Set up crabpm (Linux / Windows)
146+
if: matrix.platform != 'mac'
147+
shell: bash
148+
run: |
149+
git clone --depth=1 https://github.com/AutoCookies/crabpm.git ppm
150+
cd ppm
151+
yarn install --ignore-engines
152+
153+
- name: Set up crabpm (macOS — skip native compilation)
154+
if: matrix.platform == 'mac'
155+
shell: bash
156+
run: |
157+
git clone --depth=1 https://github.com/AutoCookies/crabpm.git ppm
158+
cd ppm
159+
yarn install --ignore-engines --ignore-scripts
160+
node script/postinstall.js
161+
162+
# ── Install project dependencies ──────────────────────────────────────
163+
- name: Install dependencies
164+
run: yarn install --ignore-engines
165+
166+
# ── Windows: restore distutils (removed in Python 3.12, needed by node-gyp)
167+
- name: Restore distutils (Windows)
168+
if: matrix.platform == 'win'
169+
run: pip install setuptools
170+
171+
# ── Rebuild native Node modules for Electron ──────────────────────────
172+
- name: Build native modules
173+
run: yarn build
174+
175+
# ── Determine flags ───────────────────────────────────────────────────
176+
- name: Determine build flags
177+
id: flags
178+
shell: bash
179+
run: |
180+
FLAGS="--platform ${{ matrix.platform }}"
181+
# Canary channel
182+
if [[ "${{ github.event.inputs.channel }}" == "next" ]]; then
183+
FLAGS="$FLAGS --next"
184+
fi
185+
# Architecture override (ARM64 cross-compile, universal macOS)
186+
if [[ "${{ matrix.arch }}" == "arm64" ]]; then
187+
FLAGS="$FLAGS --target arm64-appimage,deb,rpm,tar.gz"
188+
fi
189+
if [[ "${{ matrix.arch }}" == "universal" ]]; then
190+
FLAGS="$FLAGS --target universal"
191+
fi
192+
echo "flags=$FLAGS" >> "$GITHUB_OUTPUT"
193+
194+
# ── Build Linux distributables ─────────────────────────────────────────
195+
- name: Build (Linux)
196+
if: matrix.platform == 'linux'
197+
run: yarn dist ${{ steps.flags.outputs.flags }}
198+
199+
# ── Build Windows distributables ───────────────────────────────────────
200+
- name: Build (Windows)
201+
if: matrix.platform == 'win'
202+
run: yarn dist ${{ steps.flags.outputs.flags }}
203+
204+
# ── Build macOS distributables ─────────────────────────────────────────
205+
- name: Build (macOS)
206+
if: matrix.platform == 'mac'
207+
env:
208+
# Disable auto-discovery when no cert is present (produces unsigned build)
209+
CSC_IDENTITY_AUTO_DISCOVERY: ${{ secrets.MACOS_CERT_P12 != '' && 'true' || 'false' }}
210+
APPLE_ID: ${{ secrets.APPLE_ID }}
211+
APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
212+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
213+
run: yarn dist ${{ steps.flags.outputs.flags }}
214+
215+
# ── List produced files ────────────────────────────────────────────────
216+
- name: List dist output
217+
shell: bash
218+
run: ls -lh dist/ || true
219+
220+
# ── Upload artifacts (kept 90 days, always; used by release job) ───────
221+
- name: Upload artifacts
222+
uses: actions/upload-artifact@v4
223+
with:
224+
name: ${{ matrix.artifact_name }}
225+
path: |
226+
dist/*.AppImage
227+
dist/*.deb
228+
dist/*.rpm
229+
dist/*.tar.gz
230+
dist/*.exe
231+
dist/*.zip
232+
dist/*.dmg
233+
if-no-files-found: warn
234+
retention-days: 90
235+
236+
# ────────────────────────────────────────────────────────────────────────
237+
# Release — collect all artifacts and publish a GitHub Release
238+
# Only runs when triggered by a version tag push.
239+
# ────────────────────────────────────────────────────────────────────────
240+
release:
241+
name: Publish Release
242+
needs: build
243+
runs-on: ubuntu-latest
244+
if: startsWith(github.ref, 'refs/tags/v')
245+
permissions:
246+
contents: write
247+
248+
steps:
249+
- name: Checkout (for release notes)
250+
uses: actions/checkout@v4
251+
with:
252+
fetch-depth: 0
253+
254+
- name: Download all platform artifacts
255+
uses: actions/download-artifact@v4
256+
with:
257+
path: release-files/
258+
merge-multiple: true
259+
260+
- name: List release files
261+
run: ls -lhR release-files/
262+
263+
- name: Determine release type
264+
id: rel
265+
run: |
266+
TAG="${GITHUB_REF_NAME}"
267+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
268+
if echo "$TAG" | grep -qE '-(alpha|beta|rc)'; then
269+
echo "prerelease=true" >> "$GITHUB_OUTPUT"
270+
else
271+
echo "prerelease=false" >> "$GITHUB_OUTPUT"
272+
fi
273+
274+
- name: Create GitHub Release
275+
uses: softprops/action-gh-release@v2
276+
with:
277+
tag_name: ${{ steps.rel.outputs.tag }}
278+
name: SyntaxVoid ${{ steps.rel.outputs.tag }}
279+
prerelease: ${{ steps.rel.outputs.prerelease }}
280+
draft: false
281+
generate_release_notes: true
282+
body: |
283+
## SyntaxVoid ${{ steps.rel.outputs.tag }}
284+
285+
### Downloads
286+
287+
| Platform | Format | Notes |
288+
|---|---|---|
289+
| Linux | `.AppImage` | Universal, no install needed |
290+
| Linux | `.deb` | Debian / Ubuntu |
291+
| Linux | `.rpm` | Fedora / RHEL |
292+
| Linux | `.tar.gz` | Manual install |
293+
| Windows | `.exe` | NSIS installer |
294+
| Windows | `.zip` | Portable |
295+
| macOS | `.dmg` | Drag-and-drop install |
296+
| macOS | `.zip` | Portable |
297+
298+
> **Note**: macOS builds may be unsigned. Right-click → Open on first launch.
299+
300+
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for full details.
301+
files: release-files/**/*

0 commit comments

Comments
 (0)