Skip to content

Commit

Permalink
ci: Add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Aug 9, 2024
1 parent 8c14a21 commit 53759c8
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- uses: eifinger/setup-rye@v3
with:
version: latest
- run: |
rye build
rye publish
- run: deno run -A 'npm:[email protected]'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ select = [

[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["D", "S"]

[tool.hatch.build.hooks.custom]
path = "scripts/hatch_build.py"
19 changes: 19 additions & 0 deletions scripts/hatch_build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""A Hatchling plugin to build the quak frontend."""

import pathlib
import subprocess

from hatchling.builders.hooks.plugin.interface import BuildHookInterface

ROOT = pathlib.Path(__file__).parent / ".."


class QuakBuildHook(BuildHookInterface):
"""Hatchling plugin to build the quak frontend."""

PLUGIN_NAME = "quak"

def initialize(self, version: str, build_data: dict) -> None:
"""Initialize the plugin."""
if not (ROOT / "src/quak/widget.js").exists():
subprocess.check_call(["deno", "task", "build"], cwd=ROOT)

0 comments on commit 53759c8

Please sign in to comment.