Created ci.yml, added release for windows, mac and linux
This commit is contained in:
1 parent
0eb340e1c2
commit
e241442302
5 files changed
+144
-1
No files matched your search
@@ -0,0 +1,102 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
verify:
|
||||||
|
name: Verify (build + tests)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: npm
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run tests (if present)
|
||||||
|
run: npm run test --if-present
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
package:
|
||||||
|
name: Package (${{ matrix.name }})
|
||||||
|
needs: verify
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- name: Windows
|
||||||
|
os: windows-latest
|
||||||
|
platform: win
|
||||||
|
arch: x64
|
||||||
|
artifact_glob: release/*.exe
|
||||||
|
- name: Linux
|
||||||
|
os: ubuntu-latest
|
||||||
|
platform: linux
|
||||||
|
arch: x64
|
||||||
|
artifact_glob: release/*.AppImage
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: npm
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build app bundles
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Build installers
|
||||||
|
env:
|
||||||
|
CSC_IDENTITY_AUTO_DISCOVERY: "false"
|
||||||
|
run: npx electron-builder --${{ matrix.platform }} --${{ matrix.arch }} --publish never
|
||||||
|
|
||||||
|
- name: Upload installer artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: 5ET-D-${{ matrix.platform }}-${{ github.sha }}
|
||||||
|
path: ${{ matrix.artifact_glob }}
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
macos_source:
|
||||||
|
name: Package (macOS arm64 source)
|
||||||
|
needs: verify
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Create source archive for macOS arm64 users
|
||||||
|
run: |
|
||||||
|
mkdir -p release
|
||||||
|
git archive --format=tar.gz --output="release/5ET-D-macos-arm64-source-${GITHUB_SHA::7}.tar.gz" HEAD
|
||||||
|
|
||||||
|
- name: Upload macOS source artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: 5ET-D-macos-arm64-source-${{ github.sha }}
|
||||||
|
path: release/5ET-D-macos-arm64-source-*.tar.gz
|
||||||
|
if-no-files-found: error
|
||||||
@@ -51,6 +51,22 @@ npm run dist
|
|||||||
|
|
||||||
This command installs `electron-builder` on demand via `npx` for packaging, rather than during every local dependency install.
|
This command installs `electron-builder` on demand via `npx` for packaging, rather than during every local dependency install.
|
||||||
|
|
||||||
|
## macOS arm64 (source release workflow)
|
||||||
|
|
||||||
|
If macOS runners are unavailable in CI, publish the `5ET-D-macos-arm64-source-*` artifact and have Apple Silicon users build locally:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./build-macos-arm64.command
|
||||||
|
```
|
||||||
|
|
||||||
|
Equivalent CLI command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./scripts/build-macos-arm64.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
This builds a macOS arm64 package and writes output to `release/`.
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
- The app starts an internal local HTTP server for wiki content.
|
- The app starts an internal local HTTP server for wiki content.
|
||||||
|
|||||||
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
cd "${SCRIPT_DIR}"
|
||||||
|
|
||||||
|
./scripts/build-macos-arm64.sh
|
||||||
+2
-1
@@ -18,7 +18,8 @@
|
|||||||
"dev:web": "concurrently -k \"npm:dev:main\" \"npm:dev:renderer:web\" \"npm:dev:electron:web\"",
|
"dev:web": "concurrently -k \"npm:dev:main\" \"npm:dev:renderer:web\" \"npm:dev:electron:web\"",
|
||||||
"start": "npm run build && node scripts/run-electron.cjs .",
|
"start": "npm run build && node scripts/run-electron.cjs .",
|
||||||
"pack": "npm run build && npx electron-builder --dir",
|
"pack": "npm run build && npx electron-builder --dir",
|
||||||
"dist": "npm run build && npx electron-builder"
|
"dist": "npm run build && npx electron-builder",
|
||||||
|
"dist:mac:arm64": "npm run build && CSC_IDENTITY_AUTO_DISCOVERY=false npx electron-builder --mac --arm64 --publish never"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron": "40.6.0",
|
"electron": "40.6.0",
|
||||||
|
|||||||
Executable
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||||
|
|
||||||
|
cd "${REPO_ROOT}"
|
||||||
|
|
||||||
|
echo "Building 5ET-D for macOS arm64..."
|
||||||
|
echo "Working directory: ${REPO_ROOT}"
|
||||||
|
|
||||||
|
npm ci
|
||||||
|
npm run dist:mac:arm64
|
||||||
|
|
||||||
|
echo "Done. Check the release/ directory for the macOS arm64 artifact."
|
||||||
Reference in new issue
Block a user