Skip to content

Build

Build #1

Workflow file for this run

name: Build
on:
workflow_dispatch:
workflow_call:
permissions:
contents: read
jobs:
package:
name: Build ${{ matrix.platform }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- platform: linux
arch: x64
os: ubuntu-latest
builder_args: --linux AppImage deb --x64
- platform: macos
arch: x64
os: macos-15-intel
builder_args: --mac dmg zip --x64
- platform: macos
arch: arm64
os: macos-14
builder_args: --mac dmg zip --arm64
- platform: windows
arch: x64
os: windows-latest
builder_args: --win portable nsis --x64
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Test
run: npm test
- name: Build renderer and main
run: npm run build:force
- name: Package app
shell: bash
run: npx electron-builder ${{ matrix.builder_args }} --publish never -c.compression=maximum
- name: Generate checksums
shell: bash
run: |
python - <<'PY'
from hashlib import sha256
from pathlib import Path
platform = "${{ matrix.platform }}"
arch = "${{ matrix.arch }}"
release_dir = Path("release")
checksum_path = release_dir / f"SHA256SUMS-{platform}-{arch}.txt"
lines = []
for path in sorted(release_dir.iterdir()):
if path.is_file() and path.name != checksum_path.name:
lines.append(f"{sha256(path.read_bytes()).hexdigest()} {path.name}")
checksum_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
PY
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: StackDock-${{ matrix.platform }}-${{ matrix.arch }}
path: release/*
if-no-files-found: error