Skip to content
Open
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
54 changes: 54 additions & 0 deletions .github/workflows/build-wheel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build wheel

on:
- push

jobs:
build-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Set up uv
uses: astral-sh/setup-uv@v6

- name: Generate API client
run: make gen

- name: Build wheel
run: make build-wheel

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheel
path: dist/*.whl

test-wheel:
runs-on: ubuntu-latest
needs: build-wheel
steps:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Set up uv
uses: astral-sh/setup-uv@v6

- name: Download wheel artifact
uses: actions/download-artifact@v5
with:
name: wheel
path: dist

- name: Install wheel as tool
run: uv tool install --from dist/*.whl "uploader"

- name: Check CLI help
run: 'uploader --help'
3 changes: 0 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:
- name: Install deps
run: make install-dev

- name: Run codegen
run: make gen

- name: Set up Docker runtime
uses: docker/setup-buildx-action@v3

Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/release-wheel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release wheels

on:
workflow_dispatch:

jobs:
release-wheel:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04
- macos-latest
steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Set up uv
uses: astral-sh/setup-uv@v6

- name: Build wheel
run: uv build --wheel

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.os }}
path: dist/*.whl
3 changes: 0 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
- name: Install deps
run: make install-dev

- name: Run codegen
run: make gen

- name: Set up Docker runtime
uses: docker/setup-buildx-action@v3

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,5 @@ jobs:
- name: Install deps
run: make install-dev

- name: Run codegen
run: make gen

- name: Run checks
run: make check
2 changes: 1 addition & 1 deletion .template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Autogenerated - DO NOT EDIT
# Parameters of the project as generated from template
_commit: f510818
_commit: 7d1c15b
_src_path: gh:kraysent/python-template
package_name: uploader
project_name: uploader
5 changes: 4 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ install:
install-frontend:
cd frontend && yarn install --frozen-lockfile

install-dev:
install-dev: gen
uv sync --all-extras

install-dev-frontend:
Expand Down Expand Up @@ -68,6 +68,9 @@ fix-frontend:
@output=$$(cd frontend && yarn run --silent prettier --write src 2>&1) || { echo "$$output"; exit 1; }
@output=$$(cd frontend && yarn run --silent eslint --fix src 2>&1) || { echo "$$output"; exit 1; }

build-wheel: gen
uv build --wheel

# only for mac as this is faster
build:
docker build . \
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ dependencies = [
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["uploader"]
force-include = { "uploader/clients/gen" = "uploader/clients/gen" }

[dependency-groups]
dev = [
"ruff~=0.15.0",
Expand Down
Loading