Skip to content

Commit 53759c8

Browse files
committed
ci: Add release action
1 parent 8c14a21 commit 53759c8

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
push:
3+
tags:
4+
- "v*"
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- uses: denoland/setup-deno@v1
17+
with:
18+
deno-version: v1.x
19+
- uses: eifinger/setup-rye@v3
20+
with:
21+
version: latest
22+
- run: |
23+
rye build
24+
rye publish
25+
- run: deno run -A 'npm:[email protected]'
26+
env:
27+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ select = [
4646

4747
[tool.ruff.lint.per-file-ignores]
4848
"tests/*.py" = ["D", "S"]
49+
50+
[tool.hatch.build.hooks.custom]
51+
path = "scripts/hatch_build.py"

scripts/hatch_build.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""A Hatchling plugin to build the quak frontend."""
2+
3+
import pathlib
4+
import subprocess
5+
6+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
7+
8+
ROOT = pathlib.Path(__file__).parent / ".."
9+
10+
11+
class QuakBuildHook(BuildHookInterface):
12+
"""Hatchling plugin to build the quak frontend."""
13+
14+
PLUGIN_NAME = "quak"
15+
16+
def initialize(self, version: str, build_data: dict) -> None:
17+
"""Initialize the plugin."""
18+
if not (ROOT / "src/quak/widget.js").exists():
19+
subprocess.check_call(["deno", "task", "build"], cwd=ROOT)

0 commit comments

Comments
 (0)