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
16 changes: 13 additions & 3 deletions .github/workflows/desktop-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ on:
push:
tags:
- "desktop-v*"
workflow_dispatch:

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
Expand All @@ -21,13 +22,21 @@ jobs:
with:
node-version: "lts/*"

- name: Inject version from tag
working-directory: desktop-app
run: |
VERSION="${GITHUB_REF_NAME#desktop-v}"
jq --arg v "$VERSION" '.version = $v' neutralino.config.json > tmp.json \
&& mv tmp.json neutralino.config.json
echo "::notice::Building version $VERSION"

- name: Setup Neutralinojs binaries
working-directory: desktop-app
run: npm run setup

- name: Build all binaries (embedded + portable)
working-directory: desktop-app
run: npm run build:all
run: npm run build

- name: Stage release assets
working-directory: desktop-app
Expand Down Expand Up @@ -63,6 +72,7 @@ jobs:
--exclude='desktop-app/bin' \
--exclude='desktop-app/node_modules' \
--exclude='desktop-app/output' \
--exclude="desktop-app/$STAGING" \
--exclude='.git' \
desktop-app/
cd desktop-app
Expand All @@ -74,6 +84,6 @@ jobs:
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: "Markdown Viewer Desktop ${{ github.ref_name }}"
name: "${{ github.ref_name }}"
generate_release_notes: true
files: desktop-app/release-assets/*
75 changes: 39 additions & 36 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Build and Push Docker Image

on:
push:
branches: [ main ]
branches: [main]
paths-ignore:
- "desktop-app/**"
pull_request:
branches: [ main ]
branches: [main]
paths-ignore:
- "desktop-app/**"

env:
REGISTRY: ghcr.io
Expand All @@ -18,37 +22,36 @@ jobs:
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

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

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}

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

- name: Checkout repository
uses: actions/checkout@v4

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

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

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
1 change: 1 addition & 0 deletions desktop-app/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Build-generated resources
resources/js/script.js
resources/js/neutralino*
resources/styles.css
resources/assets/
resources/index.html
Expand Down
19 changes: 9 additions & 10 deletions desktop-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ node_modules/
.lite_workspace.lua

# Neutralinojs binaries and builds
/bin
/dist

# Neutralinojs client (minified)
neutralino.js
bin/
dist/

# Build-generated resources (copied from root by prepare.js)
/resources/js/script.js
/resources/styles.css
/resources/assets/
/resources/index.html
resources/js/script.js
resources/js/neutralino*
resources/styles.css
resources/assets/
resources/index.html


# Neutralinojs related files
.storage
Expand All @@ -25,4 +24,4 @@ neutralino.js
.tmp

# Docker build output
/output
output/
2 changes: 1 addition & 1 deletion desktop-app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COPY . .
WORKDIR /app/desktop-app

# Setup (download binaries + prepare resources) and build all variants
RUN npm run build:all
RUN npm run build

# Final stage: Export the dist artifacts
FROM alpine:latest
Expand Down
35 changes: 29 additions & 6 deletions desktop-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Neutralinojs platform binaries are managed by `setup-binaries.js`, which downloa
Desktop-only files (not generated):

- `resources/js/main.js` — Neutralinojs lifecycle, tray menu, window events
- `resources/js/neutralino.js` — Neutralinojs client library
- `neutralino.config.json` — App configuration
- `setup-binaries.js` — Idempotent binary setup (downloads on first use)
- `setup-binaries.js` — Idempotent binary setup (downloads on first use or updates if `cli.binaryVersion` changes)

## Development

Expand Down Expand Up @@ -45,7 +44,7 @@ For more information, see the [Neutralinojs documentation](https://neutralino.js

### Building the app

**Default** — Single-file executables with embedded resources:
**Default** — Single-file executables with embedded resources + release ZIP bundle with separate `resources.neu` file:

```bash
npm run build
Expand All @@ -57,10 +56,10 @@ npm run build
npm run build:portable
```

**Both** — Build embedded + portable in one step:
**Embedded** — Single-file executables with embedded resources:

```bash
npm run build:all
npm run build:embedded
```

Build output is placed in `dist/`.
Expand All @@ -79,7 +78,31 @@ Build artifacts will be output to `desktop-app/output/`.

## Releases

Prebuilt binaries are automatically built and published as GitHub Releases when a tag matching `desktop-v*` is pushed (e.g., `desktop-v1.0.0`). See [`.github/workflows/desktop-build.yml`](../.github/workflows/desktop-build.yml).
Prebuilt binaries are automatically built and published as GitHub Releases when a tag matching `desktop-v*` is pushed (e.g., `desktop-v2026.2.0`). See [`.github/workflows/desktop-build.yml`](../.github/workflows/desktop-build.yml).

### Versioning

The Git tag is the **single source of truth** for the release version, using CalVer (Calendar Versioning) format `desktop-vYYYY.M.P`;

- `YYYY` = Year
- `M` = Month
- `P` = Patch (Defaults to 0, bumped if new release occurs same month)

The CI workflow extracts the version from the tag (e.g., `desktop-v2026.2.0` → `2026.2.0`) and injects it into `neutralino.config.json` at build time. `package.json` carries a placeholder version (`0.0.0-dev`) since this is *not* an npm package.

To create a release, you can use the utility script `tag.sh` to calculate the next [lightweight tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging):

```bash
./tag.sh # Calculates the next tag based on the current date, latest tag, and commit SHA
```

or run the following commands, replacing `<YYYY.M.P>` with the desired version (e.g., `2026.2.1`):

```bash
git tag desktop-v<YYYY.M.P> && git push origin desktop-v<YYYY.M.P>
```

### Release assets

Each release includes:

Expand Down
4 changes: 2 additions & 2 deletions desktop-app/neutralino.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/neutralinojs/neutralinojs/main/schemas/neutralino.config.schema.json",
"applicationId": "js.neutralino.sample",
"version": "1.0.0",
"applicationId": "js.markdownviewer.desktop",
"version": "2026.2.0",
"defaultMode": "window",
"port": 0,
"documentRoot": "/resources/",
Expand Down
22 changes: 17 additions & 5 deletions desktop-app/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
{
"name": "markdown-viewer-desktop",
"version": "1.0.0",
"author": "ramezio",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/ramezio/markdown-viewer-fork.git"
},
"contributors": [
"ramezio",
"JBroeren",
"ThisIs-Developer"
],
"version": "0.0.0-dev",
"private": true,
"description": "Neutralinojs desktop port of Markdown Viewer",
"description": "Neutralinojs desktop port of Markdown Viewer (https://github.com/ThisIs-Developer/markdown-viewer)",
"scripts": {
"setup": "node setup-binaries.js",
"postsetup": "node prepare.js",
"clean": "rm -rf bin dist node_modules .tmp .neutralinojs.log resources/js/script.js resources/styles.css resources/assets resources/index.html resources/js/neutralino.js resources/js/neutralino.d.ts",
"predev": "npm run setup",
"dev": "npx -y @neutralinojs/neu@11.7.0 run",
"prebuild": "npm run setup",
"build": "npx -y @neutralinojs/neu@11.7.0 build --embed-resources",
"build:portable": "npx -y @neutralinojs/neu@11.7.0 build --release",
"build:all": "npm run build && npm run build:portable"
"build": "npx -y @neutralinojs/neu@11.7.0 build --embed-resources --release",
"build:portable": "npm run setup && npx -y @neutralinojs/neu@11.7.0 build --release",
"build:embedded": "npm run setup && npx -y @neutralinojs/neu@11.7.0 build --embed-resources"
},
"dependencies": {}
}
Binary file not shown.
Binary file removed desktop-app/resources/assets/code.png
Binary file not shown.
Binary file removed desktop-app/resources/assets/github.png
Binary file not shown.
Binary file removed desktop-app/resources/assets/icon.jpg
Binary file not shown.
Binary file removed desktop-app/resources/assets/live-peview.gif
Binary file not shown.
Binary file removed desktop-app/resources/assets/mathexp.png
Binary file not shown.
Binary file removed desktop-app/resources/assets/mermaid.png
Binary file not shown.
Binary file removed desktop-app/resources/assets/table.png
Binary file not shown.
Loading
Loading