Skip to content

Commit 6e8c0f8

Browse files
committed
CI release workflow with build attestations
Move artifact production into GitHub Actions: - .github/workflows/release.yml triggers on bare-numeric tag push (1.0.0, 1.0.1, ...), runs npm ci + build, attests the three release files via actions/attest-build-provenance, and creates the GitHub Release with auto-generated notes. - Drop committed dist/ — built fresh in CI each release, no more diff noise from rebuilds. Manual users download assets from the latest release rather than checking out the repo. - Trim versions.json to just the current version. Older entries were redundant (same minAppVersion floor) and re-adding history only makes sense if we ever raise minAppVersion for a specific release. Bumps version to 1.0.3 to validate the workflow end-to-end.
1 parent aa9e568 commit 6e8c0f8

9 files changed

Lines changed: 60 additions & 38 deletions

File tree

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
7+
8+
permissions:
9+
contents: write
10+
id-token: write
11+
attestations: write
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
cache: npm
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Build
30+
run: npm run build
31+
32+
- name: Attest build provenance
33+
uses: actions/attest-build-provenance@v2
34+
with:
35+
subject-path: |
36+
dist/html-docs/main.js
37+
dist/html-docs/manifest.json
38+
dist/html-docs/styles.css
39+
40+
- name: Create GitHub Release
41+
env:
42+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
run: |
44+
tag="${GITHUB_REF#refs/tags/}"
45+
gh release create "$tag" \
46+
--title "$tag" \
47+
--generate-notes \
48+
dist/html-docs/main.js \
49+
dist/html-docs/manifest.json \
50+
dist/html-docs/styles.css

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
2+
dist/
23
*.js.map
34
.DS_Store

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HTML Docs
22

3-
A minimal plugin to bring the [unreasonable effectiveness of HTML](https://x.com/trq212/status/2052809885763747935) to Obsidian.
3+
A zero-dependency minimal plugin to bring the [unreasonable effectiveness of HTML](https://x.com/trq212/status/2052809885763747935) to Obsidian.
44

55
* The HTML is rendered in a sandboxed `<iframe>`.
66
* JS can run inside the HTML for interactivity, but the iframe is isolated from Obsidian and your vault.
@@ -10,17 +10,19 @@ Fork and extend if you want other features.
1010

1111
## Demo
1212

13-
A minimal plugin that lets you write docs in .md or .html and open both inside Obsidian
13+
A minimal plugin that lets you work with .md AND .html docs inside Obsidian
1414

1515
![](demo.png)
1616

1717
## Install (manual)
1818

19-
1. Copy the `dist/html-docs/` folder into your vault at `<vault>/.obsidian/plugins/` (so the plugin lives at `<vault>/.obsidian/plugins/html-docs/`).
19+
1. Download `main.js`, `manifest.json`, and `styles.css` from the [latest release](https://github.com/smcllns/obsidian-plugin-html-docs/releases/latest) and drop them into `<vault>/.obsidian/plugins/html-docs/`.
2020
2. Enable **HTML Docs** in Obsidian's Community Plugins settings.
2121
3. Turn on **Settings → Files & Links → Detect all file extensions** so `.html` files appear in the file explorer. The plugin shows a one-time notice on load if it isn't already on.
2222

23-
To build from source instead: `npm install && npm run build` rebuilds `dist/html-docs/`.
23+
Releases are built and signed by GitHub Actions ([release.yml](.github/workflows/release.yml)) so the binaries carry a [build attestation](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds) you can verify against the source.
24+
25+
To build from source instead: `npm install && npm run build` produces `dist/html-docs/` ready to copy.
2426

2527
## What works
2628

dist/html-docs/main.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

dist/html-docs/manifest.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

dist/html-docs/styles.css

Lines changed: 0 additions & 13 deletions
This file was deleted.

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "html-docs",
33
"name": "HTML Docs",
4-
"version": "1.0.2",
4+
"version": "1.0.3",
55
"minAppVersion": "1.4.0",
66
"description": "A minimal zero-dependency plugin that lets you write docs in .md or .html and open both inside your vault.",
77
"author": "smcllns",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "html-docs",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "A minimal zero-dependency Obsidian plugin that lets you write docs in .md or .html and open both inside Obsidian.",
55
"main": "main.js",
66
"scripts": {

versions.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"1.0.0": "1.4.0",
3-
"1.0.1": "1.4.0",
4-
"1.0.2": "1.4.0"
2+
"1.0.3": "1.4.0"
53
}

0 commit comments

Comments
 (0)