Skip to content

Build and Publish

Build and Publish #4

name: Build and Publish
permissions:
id-token: write
contents: read
on:
workflow_dispatch:
release:
types: [created]
jobs:
build-and-publish:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
steps:
- name: Checkout repo with submodules
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
persist-credentials: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Sync and update FracturedJson submodule
shell: bash
run: |
set -euo pipefail
git submodule sync --recursive
git submodule update --init --recursive
pushd FracturedJson
git fetch --no-tags origin main
git checkout -B main origin/main
git reset --hard origin/main
popd
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --locked --all-extras --dev
- name: Build FracturedJson binaries
run: uv run python3 src/build/build_binaries.py
- name: Run tests
run: uv run pytest
- name: Build distribution
run: uv build
- name: Publish to PyPI
run: uv publish