Skip to content

Commit 7e5cb3b

Browse files
committed
Add GitHub build action + release notes for v0.1.0
1 parent f4f8a94 commit 7e5cb3b

File tree

3 files changed

+214
-16
lines changed

3 files changed

+214
-16
lines changed

.github/workflows/build.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
# fail early if release notes dont exist
14+
release-notes-check:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v6
19+
20+
- name: Fail early if release notes dont exist on a tagged release
21+
if: github.ref_type == 'tag'
22+
run: |
23+
FILE="${{ github.ref_name }}-RELEASE.md"
24+
25+
if [ ! -f "$FILE" ]; then
26+
echo "Release notes werent found for this tagged release. Aborting."
27+
exit 1
28+
fi
29+
30+
echo "Found release notes"
31+
32+
build:
33+
needs: release-notes-check
34+
runs-on: ubuntu-latest
35+
36+
strategy:
37+
matrix:
38+
include:
39+
- os: linux
40+
arch: amd64
41+
- os: linux
42+
arch: arm64
43+
44+
- os: darwin
45+
arch: amd64
46+
- os: darwin
47+
arch: arm64
48+
49+
- os: windows
50+
arch: amd64
51+
- os: windows
52+
arch: arm64
53+
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v6
57+
58+
- name: Setup Go
59+
uses: actions/setup-go@v6
60+
with:
61+
go-version: "1.25"
62+
63+
- name: Build
64+
run: |
65+
mkdir -p dist
66+
EXT=""
67+
if [ "${{ matrix.os }}" = "windows" ]; then EXT=".exe"; fi
68+
69+
if [ "${{ github.ref_type }}" = "tag" ]; then
70+
VERSION="${{ github.ref_name }}"
71+
else
72+
VERSION="development-build"
73+
fi
74+
75+
COMMIT=${{ github.sha }}
76+
DATE=$(date -u +"%Y-%m-%d@%H:%M:%S")
77+
78+
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} \
79+
go build \
80+
-ldflags "\
81+
-X sklair/constants.Version=$VERSION \
82+
-X sklair/constants.Commit=$COMMIT \
83+
-X sklair/constants.BuildDate=$DATE \
84+
" \
85+
-o dist/sklair-${{ matrix.os }}-${{ matrix.arch }}$EXT
86+
87+
- name: Upload artefacts
88+
uses: actions/upload-artifact@v6
89+
with:
90+
name: sklair-${{ matrix.os }}-${{ matrix.arch }}
91+
path: dist/*
92+
93+
release:
94+
needs:
95+
- release-notes-check
96+
- build
97+
runs-on: ubuntu-latest
98+
99+
steps:
100+
- uses: actions/checkout@v6 # this is only used to get the release notes for action-gh-release
101+
102+
- name: Download artefacts
103+
uses: actions/download-artifact@v7
104+
with:
105+
path: dist
106+
107+
- name: Create release
108+
uses: softprops/action-gh-release@v2
109+
if: github.ref_type == 'tag'
110+
with:
111+
files: dist/**/*
112+
body_path: ${{ github.ref_name }}-RELEASE.md
113+
# generate_release_notes: true

constants/version.go

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
package constants
22

3+
// these are replaced by ldflags during compile time on release
34
var (
4-
Version = "0.1.0" // to be replaced by ldflags during compile time in a GitHub runner
5-
Commit = "unknown" // likewise
6-
BuildDate = "unknown" // likewise, ISO-8601 UTC
5+
Version = "development-build" // `MAJOR.MINOR.PATCH`, semantic versioning
6+
Commit = "unknown commit"
7+
BuildDate = "unknown date" // `YYYY-MM-DD at HH:MM:SS`
78
)
8-
9-
/*
10-
VERSION=v0.0.0
11-
COMMIT=$(git rev-parse --short HEAD)
12-
DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
13-
14-
go build \
15-
-ldflags "\
16-
-X sklair/constants.Version=$VERSION \
17-
-X sklair/constants.Commit=$COMMIT \
18-
-X sklair/constants.BuildDate=$DATE \
19-
"
20-
*/

v0.1.0-RELEASE.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# **Sklair 0.1.0 🎉**
2+
3+
*HTML deserved better.*
4+
5+
This is the **first official release** of Sklair - a compiler that brings structure, composability, and performance back to plain HTML without turning the web into a JavaScript framework.
6+
7+
---
8+
9+
## What's included in v0.1.0 🥹
10+
11+
This release is a bit more than just a prototype, its a complete pipeline that works. But as always, improvements can be made.
12+
13+
### Component system
14+
15+
- HTML files act as components
16+
- Components can define both `<head>` and `<body>` content
17+
- Head nodes are automatically deduplicated across components
18+
- Components are cached lazily for performance
19+
20+
### Heuristic head ordering pass
21+
22+
Sklair doesn’t just concatenate `<head>` tags, it **understands** them.
23+
24+
- Nodes are classified (charset, viewport, styles, scripts, analytics, SEO, etc.)
25+
- They are sorted into an optimal order
26+
- Duplicates are removed using structural hashing
27+
- Social meta (OpenGraph + Twitter) and others which have no effect on what a user sees at all is grouped and placed at the end
28+
29+
### Ordering barriers
30+
31+
During the head ordering pass, some things might break if they are moved around in the wrong order.
32+
33+
The best example I can think of is importing `cdn.tailwindcss.com` and needing `tailwind.config` to come *after* the TailwindCSS script is imported, not before.
34+
35+
Some things must stay together. Sklair lets you enforce that.
36+
37+
```html
38+
<!-- sklair:ordering-barrier treat-as=dont-care -->
39+
<meta property="og:title" >
40+
<meta name="twitter:title" >
41+
<!-- sklair:ordering-barrier-end -->
42+
```
43+
44+
Sklair will keep those nodes together while still optimising everything else.
45+
46+
### `sklair:remove`
47+
48+
You can include tags for editor previews that will **never ship**:
49+
50+
```html
51+
<!-- sklair:remove -->
52+
<script src="https://cdn.tailwindcss.com"></script>
53+
<!-- sklair:remove-end -->
54+
```
55+
56+
This is perfect for things like component previews in VSCode without polluting production builds.
57+
58+
### gitignore-style excludes
59+
60+
No more ugly `**/**/**`, Sklair now accepts gitignore-style excludes which are automatically normalised to doublestar globs.
61+
62+
```json
63+
"exclude": [
64+
".git",
65+
"node_modules",
66+
".env*",
67+
"*.psd",
68+
"!important.psd"
69+
]
70+
```
71+
72+
### `sklair serve`
73+
74+
A real development server with file watching via [fsnotify](https://github.com/fsnotify/fsnotify), automatic rebuilds, websocket-based live reload, and support for custom user-created 404 pages.
75+
76+
### ⚙️ Proper CLI
77+
78+
- `sklair build`
79+
- `sklair config`
80+
- `sklair docs`
81+
- `sklair init`
82+
- `sklair serve`
83+
- `sklair version`
84+
- Global `--debug`, `--verbose`, `--silent` verbosity flags
85+
86+
Note that the verbosity flags must come before any command. E.g. `sklair --debug build`.
87+
88+
---
89+
90+
## Whats next
91+
92+
0.1.0 is the foundation, for now. Coming next will be component nesting, circular dependency detection, dynamic resource hints, full Lua block support, a stable pre/post-build hook system, and finally distribution of sklair via package managers like brew, winget and maybe apt.
93+
94+
---
95+
96+
**HTML deserved better.
97+
Now it has Sklair.**

0 commit comments

Comments
 (0)