Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ javascript
.git
*.s9pk
pkg

# StartOS packaging — not part of the app image, and excluding it keeps a
# packaging-only edit from invalidating the image build cache.
startos
tsconfig.startos.json
Makefile
117 changes: 29 additions & 88 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,100 +1,24 @@
name: Release

# This fork maintains only the StartOS wrapper. The Docker image is built and
# published by upstream (heatpunk/blisspoint); we pack an s9pk against the tag
# named in startos/manifest/index.ts and never push an image of our own.

on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
version:
description: 'Version (e.g. 0.1.1)'
required: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker:
name: Build & push Docker image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
version: ${{ steps.meta.outputs.version }}
steps:
- uses: actions/checkout@v5

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Resolve version
id: resolve
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
else
echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
fi

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ steps.resolve.outputs.version }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

s9pk:
name: Build s9pk & create release
runs-on: ubuntu-latest
needs: docker
permissions:
contents: write
packages: read
steps:
- uses: actions/checkout@v5

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get version
id: ver
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
else
echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
fi

- name: Install squashfs-tools-ng
run: sudo apt-get update && sudo apt-get install -y squashfs-tools-ng

Expand All @@ -108,11 +32,19 @@ jobs:
cd "$GITHUB_WORKSPACE/.."
"$HOME/.local/bin/start-cli" s9pk init-workspace

- name: Install sdk-build deps
run: npm --prefix sdk-build install
- uses: actions/setup-node@v5
with:
node-version: '20'
cache: 'npm'

- name: Install deps
run: npm ci

- name: Build SDK JavaScript
run: cd sdk-build && npm run build
- name: Typecheck and bundle the StartOS package
run: |
npm run startos:check
node node_modules/@start9labs/start-sdk/lint.mjs
npm run startos:build

- name: Generate developer key
run: |
Expand All @@ -123,21 +55,30 @@ jobs:
run: |
echo "127.0.0.1 dev-vm.local" | sudo tee -a /etc/hosts
start-cli s9pk pack \
--javascript "$GITHUB_WORKSPACE/sdk-build/javascript" \
--javascript "$GITHUB_WORKSPACE/javascript" \
--icon startos/icon.png \
--instructions startos/instructions.md \
--license LICENSE \
--no-assets \
--assets "$GITHUB_WORKSPACE/assets" \
-o blisspoint.s9pk

- name: Inspect manifest
run: start-cli s9pk inspect blisspoint.s9pk manifest

- name: Resolve package version
id: ver
run: |
v=$(start-cli s9pk inspect blisspoint.s9pk manifest | jq -r .version)
# git refs cannot contain ':', so the tag form replaces it with '_'
echo "version=$v" >> "$GITHUB_OUTPUT"
echo "tag=v${v//:/_}" >> "$GITHUB_OUTPUT"
echo "Packaged $v"

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.ver.outputs.version }}
name: v${{ steps.ver.outputs.version }}
tag_name: ${{ github.ref_type == 'tag' && github.ref_name || steps.ver.outputs.tag }}
name: ${{ github.ref_type == 'tag' && github.ref_name || steps.ver.outputs.tag }}
files: blisspoint.s9pk
generate_release_notes: true
fail_on_unmatched_files: true
97 changes: 30 additions & 67 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,29 @@
name: Test build (s9pk artifact)

# Builds a sideloadable blisspoint.s9pk and uploads it as a workflow ARTIFACT —
# no public GitHub Release, no git tag. For testing this branch before merge.
# Download the artifact from the run's summary page, unzip, sideload in StartOS.
# The version is read from startos/manifest (the dockerTag), so it always matches.
# no GitHub Release, no git tag. For testing wrapper changes before merge:
# download the artifact from the run's summary page, unzip, sideload in StartOS.
#
# This fork maintains only the StartOS wrapper. The image is built and published
# by upstream (heatpunk/blisspoint); we pack against the tag named in
# startos/manifest/index.ts and never push an image of our own.

on:
push:
branches: [main, feature/rename-to-blisspoint]
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker:
name: Build & push Docker image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
version: ${{ steps.ver.outputs.version }}
steps:
- uses: actions/checkout@v5

- name: Resolve version from manifest
id: ver
run: |
v=$(grep -oP "blisspoint:\K[0-9]+\.[0-9]+\.[0-9]+" startos/manifest/index.ts | head -1)
echo "version=$v" >> "$GITHUB_OUTPUT"
echo "Building version $v"

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/blisspoint:${{ steps.ver.outputs.version }}
ghcr.io/${{ github.repository_owner }}/blisspoint:latest
cache-from: type=gha
cache-to: type=gha,mode=max

s9pk:
name: Build s9pk & upload artifact
runs-on: ubuntu-latest
needs: docker
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@v5

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install squashfs-tools-ng
run: sudo apt-get update && sudo apt-get install -y squashfs-tools-ng

Expand All @@ -88,11 +37,19 @@ jobs:
cd "$GITHUB_WORKSPACE/.."
"$HOME/.local/bin/start-cli" s9pk init-workspace

- name: Install sdk-build deps
run: npm --prefix sdk-build install
- uses: actions/setup-node@v5
with:
node-version: '20'
cache: 'npm'

- name: Install deps
run: npm ci

- name: Build SDK JavaScript
run: cd sdk-build && npm run build
- name: Typecheck and bundle the StartOS package
run: |
npm run startos:check
node node_modules/@start9labs/start-sdk/lint.mjs
npm run startos:build

- name: Generate developer key
run: |
Expand All @@ -103,20 +60,26 @@ jobs:
run: |
echo "127.0.0.1 dev-vm.local" | sudo tee -a /etc/hosts
start-cli s9pk pack \
--javascript "$GITHUB_WORKSPACE/sdk-build/javascript" \
--javascript "$GITHUB_WORKSPACE/javascript" \
--icon startos/icon.png \
--instructions startos/instructions.md \
--license LICENSE \
--no-assets \
--assets "$GITHUB_WORKSPACE/assets" \
-o blisspoint.s9pk

- name: Inspect manifest
run: start-cli s9pk inspect blisspoint.s9pk manifest

- name: Resolve package version
id: ver
run: |
v=$(start-cli s9pk inspect blisspoint.s9pk manifest | jq -r .version)
echo "version=${v//:/_}" >> "$GITHUB_OUTPUT"

- name: Upload s9pk artifact
uses: actions/upload-artifact@v5
with:
name: blisspoint-${{ needs.docker.outputs.version }}-s9pk
name: blisspoint-${{ steps.ver.outputs.version }}-s9pk
path: blisspoint.s9pk
retention-days: 14
if-no-files-found: error
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ dist-ssr

# StartOS build artifacts
*.s9pk
sdk-build/javascript/
sdk-build/node_modules/
javascript
ncc-cache
__pycache__/
15 changes: 8 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ säger till när filen finns att ladda ner."

## Projekt

ASIC-miner-monitor byggd i React/Vite med en Node.js-proxy mot CGMiner (port 4028).
ASIC-miner-monitor byggd i React/Vite. En Rust-tjänst (`proxy-rs`) sköter all
kommunikation med minern via biblioteket asic-rs och lyssnar på 127.0.0.1:8081;
`server/serve.cjs` serverar gränssnittet och skickar `/api/*` vidare dit.

## Releaseflöde

1. Bumpa version i `startos/versions/current.ts` och `startos/manifest/index.ts` (Docker-taggen).
2. Uppdatera `IMAGE`-variabeln i `Makefile`.
2b. Bumpa `version` i `umbrel/blisspoint/umbrel-app.yml` + image-taggen i `umbrel/blisspoint/docker-compose.yml`, och spegla till repot `heatpunk/umbrel-app-store`.
2c. Bumpa `version` i `blisspoint-addon/config.yaml` (Home Assistant hämtar imagen med versionen som tagg) och i `custom_components/blisspoint/manifest.json`.
3. Committa och pusha till `main`.
4. Trigga `release.yml` via `workflow_dispatch` med versionsnumret som input – det bygger Docker-imagen, packar `blisspoint.s9pk` och skapar en GitHub Release automatiskt.
1. Bumpa version i `startos/versions/current.ts` och Docker-taggen i `startos/manifest/index.ts`.
2. Bumpa `version` i `umbrel/blisspoint/umbrel-app.yml` + image-taggen i `umbrel/blisspoint/docker-compose.yml`, och spegla till repot `heatpunk/umbrel-app-store`.
3. Bumpa `version` i `blisspoint-addon/config.yaml` (Home Assistant hämtar imagen med versionen som tagg) och i `custom_components/blisspoint/manifest.json`.
4. Committa och pusha till `main`.
5. Trigga `release.yml` via `workflow_dispatch` – den packar `blisspoint.s9pk` mot den redan publicerade imagen och skapar en GitHub Release automatiskt. Den bygger ingen Docker-image.
14 changes: 12 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ npm run lint # ESLint
npm test # Vitest (UI utils)
cargo test --manifest-path proxy-rs/Cargo.toml # proxy-rs tests
cargo clippy --manifest-path proxy-rs/Cargo.toml --all-targets -- -D warnings
npm run startos:check # StartOS packaging typecheck
```

CI runs all of these on every PR.
Expand All @@ -36,9 +37,16 @@ CI runs all of these on every PR.
| `src/` | React/Vite UI |
| `server/serve.cjs` | Serves the built UI and reverse-proxies `/api/*` |
| `proxy-rs/` | Rust service; all miner communication via [asic-rs](https://github.com/256foundation/asic-rs) |
| `startos/` | StartOS (Start9) packaging |
| `startos/` | StartOS (Start9) packaging — see [startos/README.md](startos/README.md) |
| `umbrel/`, `blisspoint-addon/`, `custom_components/` | Umbrel and Home Assistant packaging |
| `.github/workflows/` | CI, release, and test-build pipelines |

### Building the StartOS package locally

`make x86` (or `make arm`) typechecks `startos/`, bundles it with `ncc`, and
packs a sideloadable `blisspoint_<arch>.s9pk`. It pulls the already-published
image named in `startos/manifest/index.ts` — it never builds one.

## Firmware support

Blisspoint does not implement per-firmware protocols itself — that lives upstream in **asic-rs**. If a miner isn't detected or a control action (power/pause) isn't supported, the gap is usually in asic-rs. Mappings from asic-rs data to the API are documented in [`proxy-rs/MAPPING.md`](proxy-rs/MAPPING.md).
Expand All @@ -51,7 +59,9 @@ Blisspoint does not implement per-firmware protocols itself — that lives upstr

## Releasing

Releases are cut from `main` via the `release.yml` workflow (bump the version in `startos/versions/current.ts`, `startos/manifest/index.ts` and the `Makefile`, then run the workflow). The s9pk and GitHub Release are produced automatically.
Releases are cut from `main` via the `release.yml` workflow: bump the version in `startos/versions/current.ts` and, when adopting a newer app build, the image tag in `startos/manifest/index.ts`. Then run the workflow. It packs the s9pk against the published image and creates the GitHub Release; it does **not** build or push a container image.

`startos/versions/current.ts` carries a two-part version, `<upstream>:<revision>`. Bump the upstream part when adopting a new app version; bump only the revision when the change is packaging-only. The `Makefile` reads the package id from the manifest and needs no edit.

The Umbrel packaging is version-pinned too: bump `version` in `umbrel/blisspoint/umbrel-app.yml` and the image tag in `umbrel/blisspoint/docker-compose.yml`, then mirror the changes to [heatpunk/umbrel-app-store](https://github.com/heatpunk/umbrel-app-store) so the community store serves the new version.

Expand Down
Loading
Loading