Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 0 additions & 94 deletions .github/workflows/deploy.yml

This file was deleted.

168 changes: 168 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
build-web:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Update submodules (HTTPS for CI)
run: |
git config submodule.external/ayumi.url https://github.com/paator/ayumi.git
git submodule update --init --recursive external/ayumi

- name: Verify submodule
run: test -f external/ayumi/ayumi.c || (echo "Submodule external/ayumi not present" && exit 1)

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Setup Emscripten
uses: mymindstorm/setup-emsdk@v12
with:
version: "3.1.45"

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Install dependencies
run: pnpm install --no-frozen-lockfile

- name: Build
run: |
source $EMSDK/emsdk_env.sh
export PATH=$EMSDK/upstream/emscripten:$PATH
chmod +x build-wasm.sh
EMSDK=$EMSDK bash -c 'pnpm build'
shell: bash

- name: Upload dist artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

- name: Create web zip
run: cd dist && zip -r ../bitphase-web.zip .

- name: Upload web zip artifact
uses: actions/upload-artifact@v4
with:
name: bitphase-web
path: bitphase-web.zip

build-electron:
needs: build-web
strategy:
matrix:
include:
- os: macos-latest
platform: mac
- os: ubuntu-latest
platform: linux
- os: windows-latest
platform: win
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Install dependencies
run: pnpm install --no-frozen-lockfile

- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Build Electron main process
run: pnpm electron:build-main

- name: Build Electron app (macOS)
if: matrix.platform == 'mac'
run: pnpm exec electron-builder --mac
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Electron app (Linux)
if: matrix.platform == 'linux'
run: pnpm exec electron-builder --linux
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Electron app (Windows)
if: matrix.platform == 'win'
run: pnpm exec electron-builder --win
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload artifacts (macOS)
if: matrix.platform == 'mac'
uses: actions/upload-artifact@v4
with:
name: electron-mac
path: |
release/*.dmg

- name: Upload artifacts (Linux)
if: matrix.platform == 'linux'
uses: actions/upload-artifact@v4
with:
name: electron-linux
path: |
release/*.AppImage

- name: Upload artifacts (Windows)
if: matrix.platform == 'win'
uses: actions/upload-artifact@v4
with:
name: electron-win
path: |
release/*.exe

create-release:
needs: [build-web, build-electron]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/

- name: List artifacts
run: find artifacts/ -type f

- name: Create release
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: true
files: |
artifacts/bitphase-web/*.zip
artifacts/electron-mac/*.dmg
artifacts/electron-linux/*.AppImage
artifacts/electron-win/*.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ vite.config.ts.timestamp-*
.idea/
*.wasm
/pa_ay_ts
/electron/dist
/release

21 changes: 20 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
Bitphase is a chiptune tracker for creating music on retro sound chips. Built with Svelte 5, TypeScript, Vite, and Tailwind 4.
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Overview

Bitphase is a chiptune tracker for creating music on retro sound chips. Built with Svelte 5, TypeScript, Vite, and Tailwind 4. Currently supports AY-3-8910/YM2149F chip, with architecture designed for future chip support.

## Commands

- `pnpm dev` — Start dev server (builds WASM first)
- `pnpm build` — Production build
- `pnpm check` — TypeScript and Svelte type checking (run this to catch lint errors)
- `pnpm test` — Run tests in watch mode (vitest)
- `pnpm test:run` — Run tests once
- `pnpm vitest run tests/path/to/file.test.ts` — Run a single test file
- `pnpm build:wasm` — Rebuild WASM only (requires Emscripten SDK with `emcc` in PATH)
- `pnpm electron:dev` — Build and launch Electron app
- `pnpm electron:pack` — Build platform-native installer → `release/`
- Electron build docs: [`docs/electron-build.md`](docs/electron-build.md)

## Architecture

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ A modern web-based chiptune tracker designed for creating music on retro sound c
5. **Open your browser**
Navigate to `http://localhost:5173` (or the port shown in the terminal)

## Desktop App (Electron)

Bitphase can be packaged as a standalone desktop app for macOS, Windows, and Linux. See **[docs/electron-build.md](docs/electron-build.md)** for full build instructions per platform.

Quick version:
```bash
pnpm electron:dev # Run in dev mode
pnpm electron:pack # Build installer for current platform
```

## Available Scripts

- `pnpm dev` - Build WASM and start development server with hot module replacement
Expand All @@ -61,6 +71,8 @@ A modern web-based chiptune tracker designed for creating music on retro sound c
- `pnpm check` - Run TypeScript and Svelte type checking
- `pnpm test` - Run tests in watch mode
- `pnpm test:run` - Run tests once
- `pnpm electron:dev` - Build and launch Electron app for development
- `pnpm electron:pack` - Build platform-native installer (output in `release/`)

## Project Structure

Expand Down
Loading
Loading