Skip to content
Merged
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
29 changes: 18 additions & 11 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: "Publish package and documentation"
name: publish-packages-and-docs

on:
release:
types: ["published"]
workflow_dispatch:
inputs:
is_test:
description: 'Indicates that the run should publish to the test repositories'
required: false
type: boolean
default: false

jobs:
packages:
Expand All @@ -22,16 +29,16 @@ jobs:
with:
enable-cache: true

- name: Build
run: uv build
- name: Build package
run: make build

- name: Publish RC packages to PyPI Test
if: contains(github.event.release.tag_name, '-rc')
- name: Publish packages to PyPI Test
if: ${{ github.event.inputs.run_deploy == 'true' }}
run: |
uv publish --index testpypi --token ${{ secrets.TEST_PYPI_TOKEN }}

- name: Publish release packages to PyPI
if: ${{ ! contains(github.event.release.tag_name, '-rc') }}
if: ${{ github.event.inputs.run_deploy == 'false' }}
run: uv publish --token ${{ secrets.PYPI_TOKEN }}

docs:
Expand All @@ -50,19 +57,19 @@ jobs:
enable-cache: true

- name: Generate docs
run: make install generate-docs
run: make generate-docs

- name: Publish RC docs
if: contains(github.event.release.tag_name, '-rc')
- name: Publish release docs to test location
if: ${{ github.event.inputs.run_deploy == 'true' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
# this puts the docs for this tag under gh-pages:/rc/<tag>/
destination_dir: rc/${{ github.event.release.tag_name }}

- name: Publish release docs
if: ${{ ! contains(github.event.release.tag_name, '-rc') }}
- name: Publish release docs to production location
if: ${{ github.event.inputs.run_deploy == 'false' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: test

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
Expand Down
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
UV_PYTHON ?= 3.12

.PHONY: help install test lint fmt generate-docs build-and-load-configure image build-and-load-system-test-image
.PHONY: build help install test lint fmt generate-docs build-and-load-configure image build-and-load-system-test-image

help: # Show help for each of the Makefile recipes.
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; do printf "\033[1;34m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done

install: # install dependencies for running tests and linting
uv python install

dev: install # Install development/release dependencies
uv sync --extra dev

test: install # run tests
build: install # build package
uv build

test: install dev # run tests
uv run --isolated --with-editable '.[dev]' pytest

lint: install # run linting checks
lint: install dev # run linting checks
uv run ruff check kratix_sdk tests
uv run ruff format --check kratix_sdk tests

fmt: install # run code formatter
fmt: install dev # run code formatter
uv run ruff format kratix_sdk tests

generate-docs: install # create API documentation
generate-docs: install dev # create API documentation
uv run pdoc src/kratix_sdk -o docs

build-and-load-configure-image: # build example docker image and load it into kind
Expand Down